From cc44c77ed49ea574b5af1148b89723217deb6aed Mon Sep 17 00:00:00 2001 From: Rick Parker Date: Thu, 15 Aug 2024 07:06:58 +0100 Subject: [PATCH] ENT-12108 ReceiveFinalityFlow returns a transaction that is not signed by the notary (#7804) --- .../test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt | 3 ++- .../main/kotlin/net/corda/core/flows/ReceiveTransactionFlow.kt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt b/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt index 4eb85ec26b..9c4ecf4d99 100644 --- a/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt +++ b/core-tests/src/test/kotlin/net/corda/coretests/flows/FinalityFlowTests.kt @@ -518,7 +518,8 @@ class FinalityFlowTests : WithFinality { @Suspendable override fun call() { val handleNotaryError = otherSide.receive().unwrap { it } - subFlow(ReceiveFinalityFlow(otherSide, handlePropagatedNotaryError = handleNotaryError)) + val stx = subFlow(ReceiveFinalityFlow(otherSide, handlePropagatedNotaryError = handleNotaryError)) + stx.verify(serviceHub) } } diff --git a/core/src/main/kotlin/net/corda/core/flows/ReceiveTransactionFlow.kt b/core/src/main/kotlin/net/corda/core/flows/ReceiveTransactionFlow.kt index 3fcd20ca47..d109b53f48 100644 --- a/core/src/main/kotlin/net/corda/core/flows/ReceiveTransactionFlow.kt +++ b/core/src/main/kotlin/net/corda/core/flows/ReceiveTransactionFlow.kt @@ -127,6 +127,7 @@ open class ReceiveTransactionFlow constructor(private val otherSideSession: Flow (serviceHub as ServiceHubCoreInternal).finalizeTransactionWithExtraSignatures(stx, notarySignatures, statesToRecord) logger.info("Peer finalised transaction with notary signature.") } + return stx + notarySignatures } catch (e: NotaryException) { logger.info("Peer received notary error.") val overrideHandlePropagatedNotaryError = handlePropagatedNotaryError