From 36052cbd63ed59fde629551bb66f6384d7c09b2b Mon Sep 17 00:00:00 2001 From: Andrius Dagys Date: Fri, 10 Feb 2017 10:55:17 +0000 Subject: [PATCH] Send a transaction for notarisation only if it has inputs or a timestamp --- core/src/main/kotlin/net/corda/flows/FinalityFlow.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/kotlin/net/corda/flows/FinalityFlow.kt b/core/src/main/kotlin/net/corda/flows/FinalityFlow.kt index 61a18d7ef3..91e1ff0caf 100644 --- a/core/src/main/kotlin/net/corda/flows/FinalityFlow.kt +++ b/core/src/main/kotlin/net/corda/flows/FinalityFlow.kt @@ -84,7 +84,12 @@ class FinalityFlow(val transactions: Iterable, } } - private fun needsNotarySignature(stx: SignedTransaction) = stx.tx.notary != null && hasNoNotarySignature(stx) + private fun needsNotarySignature(stx: SignedTransaction): Boolean { + val wtx = stx.tx + val needsNotarisation = wtx.inputs.isNotEmpty() || wtx.timestamp != null + return needsNotarisation && hasNoNotarySignature(stx) + + } private fun hasNoNotarySignature(stx: SignedTransaction): Boolean { val notaryKey = stx.tx.notary?.owningKey val signers = stx.sigs.map { it.by }.toSet()