disable discovery if maxPeers set to zero

This commit is contained in:
jangko 2022-03-23 21:07:11 +07:00
parent a90bf1c99a
commit 1008e87ec2
No known key found for this signature in database
GPG Key ID: 31702AE10541E6B9
1 changed files with 4 additions and 3 deletions

View File

@ -132,8 +132,9 @@ proc setupP2P(nimbus: NimbusNode, conf: NimbusConf,
asyncCheck nimbus.ethNode.peerPool.connectToNode(newNode(enode))
# Start Eth node
waitFor nimbus.ethNode.connectToNetwork(
enableDiscovery = conf.discovery != DiscoveryType.None)
if conf.maxPeers > 0:
waitFor nimbus.ethNode.connectToNetwork(
enableDiscovery = conf.discovery != DiscoveryType.None)
proc localServices(nimbus: NimbusNode, conf: NimbusConf,
chainDB: BaseChainDB, protocols: set[ProtocolFlag]) =