`bank_forks_from_snapshot()` always returns starting snapshot hashes (#32178)

This commit is contained in:
Brooks 2023-06-16 14:38:03 -04:00 committed by GitHub
parent 2aac9fca35
commit f720ca3339
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -124,7 +124,7 @@ pub fn load_bank_forks(
};
let (bank_forks, starting_snapshot_hashes) = if snapshot_present {
bank_forks_from_snapshot(
let (bank_forks, starting_snapshot_hashes) = bank_forks_from_snapshot(
genesis_config,
account_paths,
shrink_paths,
@ -132,7 +132,8 @@ pub fn load_bank_forks(
process_options,
accounts_update_notifier,
exit,
)
);
(bank_forks, Some(starting_snapshot_hashes))
} else {
let maybe_filler_accounts = process_options
.accounts_db_config
@ -197,7 +198,7 @@ fn bank_forks_from_snapshot(
process_options: &ProcessOptions,
accounts_update_notifier: Option<AccountsUpdateNotifier>,
exit: Arc<AtomicBool>,
) -> (Arc<RwLock<BankForks>>, Option<StartingSnapshotHashes>) {
) -> (Arc<RwLock<BankForks>>, StartingSnapshotHashes) {
// Fail hard here if snapshot fails to load, don't silently continue
if account_paths.is_empty() {
error!("Account paths not present when booting from snapshot");
@ -323,6 +324,6 @@ fn bank_forks_from_snapshot(
(
Arc::new(RwLock::new(BankForks::new(deserialized_bank))),
Some(starting_snapshot_hashes),
starting_snapshot_hashes,
)
}