mirror of
https://github.com/corda/corda.git
synced 2025-01-31 00:24:59 +00:00
ENT-10306 Missed actually verifying transaction from recent refactor (#7483)
This commit is contained in:
parent
615464e0c7
commit
5d84d0a5c9
@ -78,12 +78,7 @@ open class ReceiveTransactionFlow constructor(private val otherSideSession: Flow
|
||||
checkParameterHash(stx.networkParametersHash)
|
||||
subFlow(ResolveTransactionsFlow(stx, otherSideSession, statesToRecord, deferredAck))
|
||||
logger.info("Transaction dependencies resolution completed.")
|
||||
try {
|
||||
stx.verify(serviceHub, checkSufficientSignatures)
|
||||
} catch (e: Exception) {
|
||||
logger.warn("Transaction verification failed.")
|
||||
throw e
|
||||
}
|
||||
verifyTx(stx, checkSufficientSignatures)
|
||||
if (checkSufficientSignatures) {
|
||||
// We should only send a transaction to the vault for processing if we did in fact fully verify it, and
|
||||
// there are no missing signatures. We don't want partly signed stuff in the vault.
|
||||
@ -97,6 +92,15 @@ open class ReceiveTransactionFlow constructor(private val otherSideSession: Flow
|
||||
}
|
||||
}
|
||||
|
||||
private fun verifyTx(stx: SignedTransaction, localCheckSufficientSignatures: Boolean) {
|
||||
try {
|
||||
stx.verify(serviceHub, localCheckSufficientSignatures)
|
||||
} catch (e: Exception) {
|
||||
logger.warn("Transaction verification failed.")
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
private fun isDeferredAck(payload: Any): Boolean {
|
||||
return payload is SignedTransactionWithDistributionList && checkSufficientSignatures && payload.isFinality
|
||||
}
|
||||
@ -109,7 +113,7 @@ open class ReceiveTransactionFlow constructor(private val otherSideSession: Flow
|
||||
checkParameterHash(stx.networkParametersHash)
|
||||
subFlow(ResolveTransactionsFlow(stx, otherSideSession, statesToRecord, true))
|
||||
logger.info("Transaction dependencies resolution completed.")
|
||||
|
||||
verifyTx(stx, false)
|
||||
serviceHub.telemetryServiceInternal.span("${this::class.java.name}#recordUnnotarisedTransaction", flowLogic = this) {
|
||||
logger.debug { "Peer recording transaction without notary signature." }
|
||||
(serviceHub as ServiceHubCoreInternal).recordUnnotarisedTransaction(stx)
|
||||
|
Loading…
x
Reference in New Issue
Block a user