mirror of
https://github.com/corda/corda.git
synced 2024-12-18 20:47:57 +00:00
IdentitySyncFlow - loadStates of an input only if it is in local storage (#3701)
This commit is contained in:
parent
4075e29120
commit
c8de5ce08d
@ -2,6 +2,7 @@ package net.corda.confidential
|
||||
|
||||
import co.paralleluniverse.fibers.Suspendable
|
||||
import net.corda.core.contracts.ContractState
|
||||
import net.corda.core.contracts.TransactionResolutionException
|
||||
import net.corda.core.flows.FlowLogic
|
||||
import net.corda.core.flows.FlowSession
|
||||
import net.corda.core.identity.AbstractParty
|
||||
@ -53,7 +54,15 @@ object IdentitySyncFlow {
|
||||
}
|
||||
|
||||
private fun extractOurConfidentialIdentities(): Map<AbstractParty, PartyAndCertificate?> {
|
||||
val states: List<ContractState> = (serviceHub.loadStates(tx.inputs.toSet()).map { it.state.data } + tx.outputs.map { it.data })
|
||||
val inputStates: List<ContractState> = (tx.inputs.toSet()).mapNotNull {
|
||||
try {
|
||||
serviceHub.loadState(it).data
|
||||
}
|
||||
catch (e: TransactionResolutionException) {
|
||||
null
|
||||
}
|
||||
}
|
||||
val states: List<ContractState> = inputStates + tx.outputs.map { it.data }
|
||||
val identities: Set<AbstractParty> = states.flatMap(ContractState::participants).toSet()
|
||||
// Filter participants down to the set of those not in the network map (are not well known)
|
||||
val confidentialIdentities = identities
|
||||
|
Loading…
Reference in New Issue
Block a user