Check that halt_slot >= starting_slot (#29868)
* Check that halt_slot >= starting_slot * Improve message by saying where starting slot comes from
This commit is contained in:
parent
624f3d2d8c
commit
834b98aac0
|
@ -1066,7 +1066,14 @@ fn load_bank_forks(
|
|||
};
|
||||
|
||||
if let Some(halt_slot) = process_options.halt_at_slot {
|
||||
// Check if we have the slot data necessary to replay from starting_slot to >= halt_slot.
|
||||
if halt_slot < starting_slot {
|
||||
eprintln!(
|
||||
"Unable to load bank forks at slot {halt_slot} because it is less than the starting slot {starting_slot}. \
|
||||
The starting slot will be the latest snapshot slot, or genesis if --no-snapshot flag specified or no snapshots found."
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
// Check if we have the slot data necessary to replay from starting_slot to <= halt_slot.
|
||||
// - This will not catch the case when loading from genesis without a full slot 0.
|
||||
if !blockstore.slot_range_connected(starting_slot, halt_slot) {
|
||||
eprintln!("Unable to load bank forks at slot {halt_slot} due to disconnected blocks.",);
|
||||
|
|
Loading…
Reference in New Issue