devman
devman

Reputation: 502

Corda - What will happen to the transactions with unconsumed states when modified contract is integrated in the network?

I have build a CorDapp using "Yo!CorDapp" example (https://github.com/corda/spring-observable-stream), over release-v1 of Corda platform.

The CorDapp has four nodes - Controller node (provides network map service and validating notary service), "node A", "node B" and "node C". Following are the flows defined in the app -

Flow 1: "Node A" sends a trade request to "Node B". "Node C" is also notified.

Flow 2: "Node B" approves the trade request, self-signs it, gets signature from A and closes the trade. "Node C" is also notified.

Please consider following scenario -

Step 1. transaction record is created that is initiated by Node A and is still to be approved by Node B.

Step 2. the contract code is modified and is integrated in the corda network

Can Node B approve the transaction after the integration of modified contract?

Upvotes: 0

Views: 64

Answers (1)

Dan Newton
Dan Newton

Reputation: 920

Flows should be drained before upgrading a contract.

Plus, the contract that a transaction is validated against is attached to the transaction. Therefore if the transaction is built and sent for signing be another party, they will retrieve the attachment from the transaction and validate it.

Even if they had another version of the contract, it will not be used.

That being said, draining the flows is still an important step (at least for now). Other issues could arise if upgrading while flows are waiting to execute.

Upvotes: 1

Related Questions