mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-28 16:48:13 -05:00
fix(cli): make max_block optional (#1176)
This commit is contained in:
committed by
GitHub
parent
e46d0401a2
commit
ba70b3b7ef
@@ -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<u64>,
|
||||
}
|
||||
|
||||
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(
|
||||
|
||||
Reference in New Issue
Block a user