Skip to content

Commit 287faab

Browse files
authored
fix network zone config (#567)
fix network config
1 parent e507f32 commit 287faab

File tree

1 file changed

+5
-4
lines changed
  • binaries/cuprated/src/config

1 file changed

+5
-4
lines changed

binaries/cuprated/src/config/args.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ pub struct Args {
1414
/// The network to run on.
1515
#[arg(
1616
long,
17-
default_value_t = Network::Mainnet,
1817
value_parser = clap::builder::PossibleValuesParser::new(["mainnet", "testnet", "stagenet"])
19-
.map(|s| s.parse::<Network>().unwrap()),
18+
.map(|s| Some(s.parse::<Network>().unwrap())),
2019
)]
21-
pub network: Network,
20+
pub network: Option<Network>,
2221

2322
/// Disable fast sync, all past blocks will undergo full verification when syncing.
2423
///
@@ -70,7 +69,9 @@ impl Args {
7069
///
7170
/// This may exit the program if a config value was set that requires an early exit.
7271
pub const fn apply_args(&self, mut config: Config) -> Config {
73-
config.network = self.network;
72+
if let Some(network) = self.network {
73+
config.network = network;
74+
}
7475
config.fast_sync = config.fast_sync && !self.no_fast_sync;
7576

7677
if let Some(outbound_connections) = self.outbound_connections {

0 commit comments

Comments
 (0)