CORDA-521: Backwards compatible Transactions using sub-Merkle trees (#1481)

* tx backwards compatibility + rebase

* SHA256d definition
This commit is contained in:
Konstantinos Chalkias
2017-09-20 13:11:58 +01:00
committed by josecoll
parent 477ea3a5e1
commit 6887947a4d
20 changed files with 804 additions and 367 deletions

View File

@ -138,9 +138,9 @@ class BFTNonValidatingNotaryService(override val services: ServiceHubInternal, c
fun verifyAndCommitTx(ftx: FilteredTransaction, callerIdentity: Party): BFTSMaRt.ReplicaResponse {
return try {
val id = ftx.id
val inputs = ftx.filteredLeaves.inputs
val inputs = ftx.inputs
validateTimeWindow(ftx.filteredLeaves.timeWindow)
validateTimeWindow(ftx.timeWindow)
commitInputStates(inputs, id, callerIdentity)
log.debug { "Inputs committed successfully, signing $id" }
BFTSMaRt.ReplicaResponse.Signature(sign(ftx))

View File

@ -1,6 +1,7 @@
package net.corda.node.services.transactions
import co.paralleluniverse.fibers.Suspendable
import net.corda.core.contracts.ComponentGroupEnum
import net.corda.core.flows.NotaryFlow
import net.corda.core.flows.TransactionParts
import net.corda.core.identity.Party
@ -24,7 +25,9 @@ class NonValidatingNotaryFlow(otherSide: Party, service: TrustedAuthorityNotaryS
when (it) {
is FilteredTransaction -> {
it.verify()
TransactionParts(it.id, it.filteredLeaves.inputs, it.filteredLeaves.timeWindow)
it.checkAllComponentsVisible(ComponentGroupEnum.INPUTS_GROUP)
it.checkAllComponentsVisible(ComponentGroupEnum.TIMEWINDOW_GROUP)
TransactionParts(it.id, it.inputs, it.timeWindow)
}
is NotaryChangeWireTransaction -> TransactionParts(it.id, it.inputs, null)
else -> {