This commit is contained in:
djmil 2023-11-27 16:16:12 +01:00
parent b6b1358131
commit 8c1544d160
2 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,7 @@ public class CommitTrx implements SubFlow<SecureHash> {
@Suspendable
public SecureHash call() {
log.info("GameState commit started");
System.out.println("Surrender commit started");
/*
* Calls the Corda provided finalise() function which gather signatures from the counterparty,

View File

@ -57,12 +57,14 @@ public class CommitTrxResponder implements ResponderFlow {
@Suspendable
void checkParticipants(FlowSession session, UtxoLedgerTransaction gameStateUtxo) throws ParticipantException {
System.out.println("commit responder");
final GameInfo info = new GameInfo(gameStateUtxo);
final var conterpartyName = session.getCounterparty();
if (info.issuer.compareTo(conterpartyName) != 0)
throw new ParticipantException("Issuer", conterpartyName, info.issuer);
final var myName = memberLookup.myInfo().getName();
System.out.println(" my name" + myName + " opponentName "+ conterpartyName);
if (myName.getOrganizationUnit().equals("Custodian"))
return; // Custodian shall not validate state's counterparty