Uses Storages to update accounts hash in bank_to_snapshot_archive() (#28618)

This commit is contained in:
Brooks Prumo 2022-10-28 12:22:58 -04:00 committed by GitHub
parent 0b2bc987ca
commit 0232944c95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,8 @@
use {
crate::{
accounts_db::{
AccountShrinkThreshold, AccountsDbConfig, SnapshotStorage, SnapshotStorages,
AccountShrinkThreshold, AccountsDbConfig, CalcAccountsHashDataSource, SnapshotStorage,
SnapshotStorages,
},
accounts_index::AccountSecondaryIndexes,
accounts_update_notifier_interface::AccountsUpdateNotifier,
@ -2171,7 +2172,7 @@ pub fn bank_to_full_snapshot_archive(
bank.squash(); // Bank may not be a root
bank.force_flush_accounts_cache();
bank.clean_accounts(Some(bank.slot()));
bank.update_accounts_hash();
bank.update_accounts_hash_with_index_option(CalcAccountsHashDataSource::Storages, false, false);
bank.rehash(); // Bank accounts may have been manually modified by the caller
let temp_dir = tempfile::tempdir_in(bank_snapshots_dir)?;
@ -2218,7 +2219,7 @@ pub fn bank_to_incremental_snapshot_archive(
bank.squash(); // Bank may not be a root
bank.force_flush_accounts_cache();
bank.clean_accounts(Some(full_snapshot_slot));
bank.update_accounts_hash();
bank.update_accounts_hash_with_index_option(CalcAccountsHashDataSource::Storages, false, false);
bank.rehash(); // Bank accounts may have been manually modified by the caller
let temp_dir = tempfile::tempdir_in(bank_snapshots_dir)?;