From ba70b3b7ef7776770cb675f2cb9fd927bb5646be Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Sat, 4 Feb 2023 20:32:45 -0800 Subject: [PATCH] fix(cli): make max_block optional (#1176) --- bin/reth/src/node/mod.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/reth/src/node/mod.rs b/bin/reth/src/node/mod.rs index 6e7f820030..8e96eb71a1 100644 --- a/bin/reth/src/node/mod.rs +++ b/bin/reth/src/node/mod.rs @@ -83,7 +83,7 @@ pub struct Command { /// Runs the sync only up to the specified block #[arg(long = "debug.max-block", help_heading = "Debug")] - max_block: u64, + max_block: Option, } impl Command { @@ -203,8 +203,13 @@ impl Command { let body_downloader = self.spawn_bodies_downloader(config, consensus, &fetch_client, db); let stage_conf = &config.stages; - let pipeline = Pipeline::builder() - .with_max_block(self.max_block) + let mut builder = Pipeline::builder(); + + if let Some(max_block) = self.max_block { + builder = builder.with_max_block(max_block) + } + + let pipeline = builder .with_sync_state_updater(network.clone()) .add_stages( OnlineStages::new(consensus.clone(), header_downloader, body_downloader).set(