mirror of https://github.com/status-im/nim-eth.git
Do not start the peer pool loop when discovery is disabled
This commit is contained in:
parent
b1be962694
commit
680e52ec24
|
@ -104,11 +104,10 @@ proc connectToNetwork*(node: EthereumNode,
|
||||||
if enableDiscovery:
|
if enableDiscovery:
|
||||||
node.discovery.open()
|
node.discovery.open()
|
||||||
await node.discovery.bootstrap()
|
await node.discovery.bootstrap()
|
||||||
|
node.peerPool.start()
|
||||||
else:
|
else:
|
||||||
info "Discovery disabled"
|
info "Discovery disabled"
|
||||||
|
|
||||||
node.peerPool.start()
|
|
||||||
|
|
||||||
while node.peerPool.connectedNodes.len == 0:
|
while node.peerPool.connectedNodes.len == 0:
|
||||||
trace "Waiting for more peers", peers = node.peerPool.connectedNodes.len
|
trace "Waiting for more peers", peers = node.peerPool.connectedNodes.len
|
||||||
await sleepAsync(500.milliseconds)
|
await sleepAsync(500.milliseconds)
|
||||||
|
|
Loading…
Reference in New Issue