CORDA-641: Remove special case handling of notary transactions (#1675)

Move special case handling of notary transactions into `SignedTransaction`
This commit is contained in:
Ross Nicoll
2017-10-10 13:23:31 +01:00
committed by GitHub
parent 0e47e53b60
commit 242b019dc2
8 changed files with 44 additions and 46 deletions

View File

@ -38,13 +38,11 @@ class MyValidatingNotaryFlow(otherSide: FlowSession, service: MyCustomValidating
val stx = subFlow(ReceiveTransactionFlow(otherSideSession, checkSufficientSignatures = false))
val notary = stx.notary
checkNotary(notary)
var timeWindow: TimeWindow? = null
val transactionWithSignatures = if (stx.isNotaryChangeTransaction()) {
stx.resolveNotaryChangeTransaction(serviceHub)
} else {
timeWindow = stx.tx.timeWindow
stx
}
val timeWindow: TimeWindow? = if (stx.isNotaryChangeTransaction())
null
else
stx.tx.timeWindow
val transactionWithSignatures = stx.resolveTransactionWithSignatures(serviceHub)
checkSignatures(transactionWithSignatures)
return TransactionParts(stx.id, stx.inputs, timeWindow, notary!!)
} catch (e: Exception) {