mirror of
https://github.com/corda/corda.git
synced 2025-02-21 17:56:54 +00:00
CORDA-2570 revert multiple contract attachments per transaction
This commit is contained in:
parent
a6510ae952
commit
9448b9bd86
@ -100,6 +100,8 @@ class Verifier(val ltx: LedgerTransaction,
|
|||||||
if (contractWithMultipleAttachments != null) throw TransactionVerificationException.ConflictingAttachmentsRejection(ltx.id, contractWithMultipleAttachments)
|
if (contractWithMultipleAttachments != null) throw TransactionVerificationException.ConflictingAttachmentsRejection(ltx.id, contractWithMultipleAttachments)
|
||||||
|
|
||||||
val result = contractAttachmentsPerContract.toMap()
|
val result = contractAttachmentsPerContract.toMap()
|
||||||
|
|
||||||
|
// Check that there is an attachment for each contract.
|
||||||
if (result.keys != contractClasses) throw TransactionVerificationException.MissingAttachmentRejection(ltx.id, contractClasses.minus(result.keys).first())
|
if (result.keys != contractClasses) throw TransactionVerificationException.MissingAttachmentRejection(ltx.id, contractClasses.minus(result.keys).first())
|
||||||
|
|
||||||
return result
|
return result
|
||||||
@ -370,6 +372,7 @@ class Verifier(val ltx: LedgerTransaction,
|
|||||||
try {
|
try {
|
||||||
contract.verify(ltx)
|
contract.verify(ltx)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
logger.error("Error validating transaction ${ltx.id}.", e)
|
||||||
throw TransactionVerificationException.ContractRejection(ltx.id, contract, e)
|
throw TransactionVerificationException.ContractRejection(ltx.id, contract, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user