mirror of
https://github.com/corda/corda.git
synced 2024-12-22 06:17:55 +00:00
Merged in rnicoll-check-tx (pull request #469)
Add sanity check on SignedTransaction.id
This commit is contained in:
commit
3c4e89e766
@ -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.
|
// 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. */
|
/** 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() {
|
class SignaturesMissingException(val missing: Set<PublicKeyTree>, val descriptions: List<String>, override val id: SecureHash) : NamedByHash, SignatureException() {
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
|
Loading…
Reference in New Issue
Block a user