From 1008e87ec2e734de0d7c98905ac72f56445f31a7 Mon Sep 17 00:00:00 2001 From: jangko Date: Wed, 23 Mar 2022 21:07:11 +0700 Subject: [PATCH] disable discovery if maxPeers set to zero --- nimbus/nimbus.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nimbus/nimbus.nim b/nimbus/nimbus.nim index d3c469b72..b8b6cbd50 100644 --- a/nimbus/nimbus.nim +++ b/nimbus/nimbus.nim @@ -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]) = @@ -252,7 +253,7 @@ proc localServices(nimbus: NimbusNode, conf: NimbusConf, else: if conf.engineApiEnabled or conf.engineApiWsEnabled: warn "Cannot enable engine API without sealing engine", - hint = "use --engine-signer to enable sealing engine" + hint = "use --engine-signer to enable sealing engine" # metrics server if conf.metricsEnabled: