mirror of
https://github.com/corda/corda.git
synced 2025-01-18 18:56:28 +00:00
Minor: move ExcessivelyLargeTransactionGraph exception into the right place
This commit is contained in:
parent
54a73166c3
commit
adda2bbe6b
@ -36,6 +36,8 @@ class ResolveTransactionsProtocol(private val txHashes: Set<SecureHash>,
|
||||
private fun dependencyIDs(wtx: WireTransaction) = wtx.inputs.map { it.txhash }.toSet()
|
||||
}
|
||||
|
||||
class ExcessivelyLargeTransactionGraph() : Exception()
|
||||
|
||||
// Transactions to verify after the dependencies.
|
||||
private var stx: SignedTransaction? = null
|
||||
private var wtx: WireTransaction? = null
|
||||
@ -123,9 +125,10 @@ class ResolveTransactionsProtocol(private val txHashes: Set<SecureHash>,
|
||||
|
||||
// And loop around ...
|
||||
// TODO: Figure out a more appropriate DOS limit here, 5000 is simply a guess.
|
||||
// TODO: Unit test the DoS limit.
|
||||
limitCounter += nextRequests.size
|
||||
if (limitCounter > 5000)
|
||||
throw TwoPartyTradeProtocol.ExcessivelyLargeTransactionGraphException()
|
||||
throw ExcessivelyLargeTransactionGraph()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,6 @@ object TwoPartyTradeProtocol {
|
||||
class AssetMismatchException(val expectedTypeName: String, val typeName: String) : Exception() {
|
||||
override fun toString() = "The submitted asset didn't match the expected type: $expectedTypeName vs $typeName"
|
||||
}
|
||||
class ExcessivelyLargeTransactionGraphException() : Exception()
|
||||
|
||||
// This object is serialised to the network and is the first protocol message the seller sends to the buyer.
|
||||
class SellerTradeInfo(
|
||||
|
Loading…
Reference in New Issue
Block a user