mirror of
https://github.com/corda/corda.git
synced 2024-12-24 07:06:44 +00:00
Fix a race condition in the MockNode class that only shows up when used in thread-per-node mode. Witnessed in the unit tests.
This commit is contained in:
parent
c38f99419f
commit
f6e7ffdd31
@ -121,7 +121,11 @@ class MockNetwork(private val networkSendManuallyPumped: Boolean = false,
|
||||
override val nearestCity: String = "Atlantis"
|
||||
}
|
||||
val node = nodeFactory.create(path, config, this, networkMapAddress, advertisedServices.toSet(), id, keyPair)
|
||||
if (start) node.setup().start()
|
||||
if (start) {
|
||||
node.setup().start()
|
||||
if (threadPerNode && networkMapAddress != null)
|
||||
node.networkMapRegistrationFuture.get() // Block and wait for the node to register in the net map.
|
||||
}
|
||||
_nodes.add(node)
|
||||
return node
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user