From 57811dce89fa5ac7ce48aa8bc634641f331ca2fb Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Tue, 18 Feb 2020 02:32:12 +0200 Subject: [PATCH] Don't log unwanted lines in beacon_node --help --- beacon_chain/beacon_node.nim | 12 +++++------- beacon_chain/eth2_network.nim | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/beacon_chain/beacon_node.nim b/beacon_chain/beacon_node.nim index 9b266f821..09ad686fe 100644 --- a/beacon_chain/beacon_node.nim +++ b/beacon_chain/beacon_node.nim @@ -1044,6 +1044,10 @@ when hasPrompt: # createThread(t, processPromptCommands, addr p) when isMainModule: + let config = BeaconNodeConf.load( + version = clientId, + copyrightBanner = clientId & "\p" & copyrights) + when compiles(defaultChroniclesStream.output.writer): defaultChroniclesStream.output.writer = proc (logLevel: LogLevel, msg: LogOutputStr) {.gcsafe.} = @@ -1051,16 +1055,10 @@ when isMainModule: debug "Launching beacon node", version = fullVersionStr, - cmdParams = commandLineParams() + cmdParams = commandLineParams(), config randomize() - let config = BeaconNodeConf.load( - version = clientId, - copyrightBanner = clientId & "\p" & copyrights) - - debug "Configuration loaded", config - if config.logLevel != LogLevel.NONE: setLogLevel(config.logLevel) diff --git a/beacon_chain/eth2_network.nim b/beacon_chain/eth2_network.nim index 4a771dc55..05954567f 100644 --- a/beacon_chain/eth2_network.nim +++ b/beacon_chain/eth2_network.nim @@ -232,7 +232,7 @@ when networkBackend in [libp2p, libp2pDaemon]: await node.start() await sleepAsync(10.seconds) - if libp2p_successful_dials.value == 0: + if bootstrapEnrs.len > 0 and libp2p_successful_dials.value == 0: fatal "Failed to connect to any bootstrap node. Quitting" quit 1