From ad9ff66ef47a883793c4ee92dfa921839ab30a05 Mon Sep 17 00:00:00 2001 From: pawan Date: Fri, 21 Aug 2020 18:03:48 +0530 Subject: [PATCH] Fix order of testnet config load --- lighthouse/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lighthouse/src/main.rs b/lighthouse/src/main.rs index 7ad191ea919..52e90f17980 100644 --- a/lighthouse/src/main.rs +++ b/lighthouse/src/main.rs @@ -189,13 +189,16 @@ fn run( // Parse testnet config from the `testnet` and `testnet-dir` flag in that order // else, use the default - let mut optional_testnet_config = Eth2TestnetConfig::hard_coded_default()?; + let mut optional_testnet_config = None; if matches.is_present("testnet") { optional_testnet_config = clap_utils::parse_hardcoded_network(matches, "testnet")?; }; if matches.is_present("testnet-dir") { optional_testnet_config = clap_utils::parse_testnet_dir(matches, "testnet-dir")?; }; + if optional_testnet_config.is_none() { + optional_testnet_config = Eth2TestnetConfig::hard_coded_default()?; + } let builder = if let Some(log_path) = matches.value_of("logfile") { let path = log_path