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