mirror of
https://github.com/corda/corda.git
synced 2025-04-07 19:34:41 +00:00
ENT-9927 Ledger Recovery tweaks. (#7407)
This commit is contained in:
parent
49d5b6a4bf
commit
97d8549d4f
@ -60,11 +60,7 @@ open class ReceiveTransactionFlow constructor(private val otherSideSession: Flow
|
||||
}
|
||||
|
||||
val payload = otherSideSession.receive<Any>().unwrap { it }
|
||||
val stx =
|
||||
if (payload is SignedTransactionWithDistributionList) {
|
||||
(serviceHub as ServiceHubCoreInternal).recordReceiverTransactionRecoveryMetadata(payload.stx.id, otherSideSession.counterparty.name, ourIdentity.name, statesToRecord, payload.distributionList)
|
||||
payload.stx
|
||||
} else payload as SignedTransaction
|
||||
val stx = resolvePayload(payload)
|
||||
stx.pushToLoggingContext()
|
||||
logger.info("Received transaction acknowledgement request from party ${otherSideSession.counterparty}.")
|
||||
checkParameterHash(stx.networkParametersHash)
|
||||
@ -87,6 +83,15 @@ open class ReceiveTransactionFlow constructor(private val otherSideSession: Flow
|
||||
return stx
|
||||
}
|
||||
|
||||
open fun resolvePayload(payload: Any): SignedTransaction {
|
||||
return if (payload is SignedTransactionWithDistributionList) {
|
||||
if (checkSufficientSignatures || deferredAck) {
|
||||
(serviceHub as ServiceHubCoreInternal).recordReceiverTransactionRecoveryMetadata(payload.stx.id, otherSideSession.counterparty.name, ourIdentity.name, statesToRecord, payload.distributionList)
|
||||
payload.stx
|
||||
} else payload.stx
|
||||
} else payload as SignedTransaction
|
||||
}
|
||||
|
||||
/**
|
||||
* Hook to perform extra checks on the received transaction just before it's recorded. The transaction has already
|
||||
* been resolved and verified at this point.
|
||||
|
Loading…
x
Reference in New Issue
Block a user