mirror of
https://github.com/corda/corda.git
synced 2025-01-30 16:14:39 +00:00
Add sanity check on SignedTransaction.id
Add sanity check on SignedTransaction.id when deserializing the wrapped transaction. This check is already done when verifying signatures, this moves it up to an earlier step and adds a more specific error message to aid diagnosis.
This commit is contained in:
parent
d855b10817
commit
cf6a3050c3
@ -31,7 +31,11 @@ data class SignedTransaction(val txBits: SerializedBytes<WireTransaction>,
|
||||
// TODO: This needs to be reworked to ensure that the inner WireTransaction is only ever deserialised sandboxed.
|
||||
|
||||
/** Lazily calculated access to the deserialised/hashed transaction data. */
|
||||
val tx: WireTransaction by lazy { WireTransaction.deserialize(txBits) }
|
||||
val tx: WireTransaction by lazy {
|
||||
val temp = WireTransaction.deserialize(txBits)
|
||||
check(temp.id == id) { "Supplied transaction ID does not match deserialized transaction's ID - this is probably a problem in serialization/deserialization" }
|
||||
temp
|
||||
}
|
||||
|
||||
class SignaturesMissingException(val missing: Set<PublicKeyTree>, val descriptions: List<String>, override val id: SecureHash) : NamedByHash, SignatureException() {
|
||||
override fun toString(): String {
|
||||
|
Loading…
x
Reference in New Issue
Block a user