diff --git a/ledger/src/blockstore_processor.rs b/ledger/src/blockstore_processor.rs index 70cdf37b567ff5..b64cbcddeb6240 100644 --- a/ledger/src/blockstore_processor.rs +++ b/ledger/src/blockstore_processor.rs @@ -1725,7 +1725,7 @@ fn process_next_slots( blockstore: &Blockstore, leader_schedule_cache: &LeaderScheduleCache, pending_slots: &mut Vec<(SlotMeta, Bank, Hash)>, - halt_at_slot: Option, + opts: &ProcessOptions, ) -> result::Result<(), BlockstoreProcessorError> { if meta.next_slots.is_empty() { return Ok(()); @@ -1733,10 +1733,13 @@ fn process_next_slots( // This is a fork point if there are multiple children, create a new child bank for each fork for next_slot in &meta.next_slots { - let skip_next_slot = halt_at_slot - .map(|halt_at_slot| *next_slot > halt_at_slot) - .unwrap_or(false); - if skip_next_slot { + if opts + .halt_at_slot + .is_some_and(|halt_at_slot| *next_slot > halt_at_slot) + { + continue; + } + if !opts.allow_dead_slots && blockstore.is_dead(*next_slot) { continue; } @@ -1815,7 +1818,7 @@ fn load_frozen_forks( blockstore, leader_schedule_cache, &mut pending_slots, - opts.halt_at_slot, + opts, )?; let on_halt_store_hash_raw_data_for_debug = opts.on_halt_store_hash_raw_data_for_debug; @@ -1994,7 +1997,7 @@ fn load_frozen_forks( blockstore, leader_schedule_cache, &mut pending_slots, - opts.halt_at_slot, + opts, )?; } } else if on_halt_store_hash_raw_data_for_debug {