ENT-12073: Now check notary identity cache when trying to resolve party.

This commit is contained in:
Adel El-Beik 2024-08-12 14:07:48 +01:00
parent 2223d2808d
commit 73b38f24ab

View File

@ -398,7 +398,12 @@ class PersistentIdentityService(cacheFactory: NamedCacheFactory) : SingletonSeri
if (candidate != null && candidate != party) {
// Party doesn't match existing well-known party: check that the key is registered, otherwise return null.
require(party.name == candidate.name) { "Candidate party $candidate does not match expected $party" }
keyToParty[party.owningKey.toStringShort()]?.let { candidate }
if (party in notaryIdentityCache) {
candidate
}
else {
keyToParty[party.owningKey.toStringShort()]?.let { candidate }
}
} else {
// Party is a well-known party or well-known party doesn't exist: skip checks.
// If the notary is not in the network map cache, try getting it from the network parameters