Merge pull request #3876 from corda/thomas/cherry-pick-ENT-2054

Cherry pick ENT-2054
This commit is contained in:
Michele Sollecito 2018-09-05 10:14:11 +01:00 committed by GitHub
commit 6e1cbd2aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,7 @@ open class CashPaymentFlow(
val anonymousRecipient = txIdentities[recipient] ?: recipient
progressTracker.currentStep = GENERATING_TX
val builder = TransactionBuilder(notary = null)
logger.info("Generating spend for: ${builder.lockId}")
// TODO: Have some way of restricting this to states the caller controls
val (spendTX, keysForSigning) = try {
Cash.generateSpend(serviceHub,
@ -61,10 +62,13 @@ open class CashPaymentFlow(
}
progressTracker.currentStep = SIGNING_TX
logger.info("Signing transaction for: ${spendTX.lockId}")
val tx = serviceHub.signInitialTransaction(spendTX, keysForSigning)
progressTracker.currentStep = FINALISING_TX
logger.info("Finalising transaction for: ${tx.id}")
val notarised = finaliseTx(tx, setOf(recipient), "Unable to notarise spend")
logger.info("Finalised transaction for: ${notarised.id}")
return Result(notarised, anonymousRecipient)
}