Setup bank hard_forks in load_bank_forks()
This commit is contained in:
parent
455313584f
commit
390c5667f7
|
@ -148,6 +148,24 @@ pub fn load_bank_forks(
|
||||||
if process_options.full_leader_cache {
|
if process_options.full_leader_cache {
|
||||||
leader_schedule_cache.set_max_schedules(std::usize::MAX);
|
leader_schedule_cache.set_max_schedules(std::usize::MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert_eq!(bank_forks.banks().len(), 1);
|
||||||
|
if let Some(ref new_hard_forks) = process_options.new_hard_forks {
|
||||||
|
let root_bank = bank_forks.root_bank();
|
||||||
|
let hard_forks = root_bank.hard_forks();
|
||||||
|
|
||||||
|
for hard_fork_slot in new_hard_forks.iter() {
|
||||||
|
if *hard_fork_slot > root_bank.slot() {
|
||||||
|
hard_forks.write().unwrap().register(*hard_fork_slot);
|
||||||
|
} else {
|
||||||
|
warn!(
|
||||||
|
"Hard fork at {} ignored, --hard-fork option can be removed.",
|
||||||
|
hard_fork_slot
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
(bank_forks, leader_schedule_cache, starting_snapshot_hashes)
|
(bank_forks, leader_schedule_cache, starting_snapshot_hashes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -655,21 +655,6 @@ pub fn process_blockstore_from_root(
|
||||||
info!("processing ledger from slot {}...", start_slot);
|
info!("processing ledger from slot {}...", start_slot);
|
||||||
let now = Instant::now();
|
let now = Instant::now();
|
||||||
|
|
||||||
if let Some(ref new_hard_forks) = opts.new_hard_forks {
|
|
||||||
let hard_forks = bank.hard_forks();
|
|
||||||
|
|
||||||
for hard_fork_slot in new_hard_forks.iter() {
|
|
||||||
if *hard_fork_slot > start_slot {
|
|
||||||
hard_forks.write().unwrap().register(*hard_fork_slot);
|
|
||||||
} else {
|
|
||||||
warn!(
|
|
||||||
"Hard fork at {} ignored, --hard-fork option can be removed.",
|
|
||||||
hard_fork_slot
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ensure start_slot is rooted for correct replay
|
// ensure start_slot is rooted for correct replay
|
||||||
if blockstore.is_primary_access() {
|
if blockstore.is_primary_access() {
|
||||||
blockstore
|
blockstore
|
||||||
|
|
Loading…
Reference in New Issue