mirror of
https://github.com/corda/corda.git
synced 2025-06-17 06:38:21 +00:00
ENT-2014 Deletes of NodeInfo can fail to propagate leading to infinite retries (#1101)
* ENT-2014 Deletes of NodeInfo can fail to propagate leading to infinite retries
ENT-1880 Move identity key generation to network registration process
(cherry picked from commit c3ac203
)
This commit is contained in:
@ -8,8 +8,6 @@ import net.corda.core.node.NetworkParameters
|
||||
import net.corda.core.node.NodeInfo
|
||||
import net.corda.core.serialization.serialize
|
||||
import net.corda.core.utilities.NetworkHostAndPort
|
||||
import net.corda.core.utilities.contextLogger
|
||||
import net.corda.core.utilities.days
|
||||
import net.corda.nodeapi.internal.SignedNodeInfo
|
||||
import net.corda.nodeapi.internal.createDevNetworkMapCa
|
||||
import net.corda.nodeapi.internal.crypto.CertificateAndKeyPair
|
||||
@ -128,7 +126,12 @@ class NetworkMapServer(private val pollInterval: Duration,
|
||||
val hash = signedNodeInfo.raw.hash
|
||||
val nodeInfo = signedNodeInfo.verified()
|
||||
val privateNetwork = nodeNamesUUID[nodeInfo.legalIdentities[0].name]
|
||||
networkMaps.computeIfAbsent(privateNetwork, { mutableSetOf() }).add(hash)
|
||||
val map = networkMaps.computeIfAbsent(privateNetwork) { mutableSetOf() }
|
||||
map.add(hash)
|
||||
nodeInfoMap.filter { it.value.verified().legalIdentities.first().name == signedNodeInfo.verified().legalIdentities.first().name }.forEach { t, _ ->
|
||||
nodeInfoMap.remove(t)
|
||||
map.remove(t)
|
||||
}
|
||||
nodeInfoMap[hash] = signedNodeInfo
|
||||
ok()
|
||||
} catch (e: Exception) {
|
||||
|
Reference in New Issue
Block a user