HashCalc uses self.accounts_index (#23888)

This commit is contained in:
Jeff Washington (jwash) 2022-03-24 10:06:32 -05:00 committed by GitHub
parent 396b49a7c1
commit 9d3b17c635
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 11 deletions

View File

@ -981,7 +981,7 @@ struct RemoveUnrootedSlotsSynchronization {
signal: Condvar,
}
pub type AccountInfoAccountsIndex = AccountsIndex<AccountInfo>;
type AccountInfoAccountsIndex = AccountsIndex<AccountInfo>;
// This structure handles the load/store of the accounts
#[derive(Debug)]
@ -5488,7 +5488,7 @@ impl AccountsDb {
) -> Result<(Hash, u64), BankHashVerificationError> {
if !use_index {
let accounts_cache_and_ancestors = if can_cached_slot_be_unflushed {
Some((&self.accounts_cache, ancestors, &self.accounts_index))
Some((&self.accounts_cache, ancestors))
} else {
None
};
@ -5748,7 +5748,9 @@ impl AccountsDb {
PUBKEY_BINS_FOR_CALCULATING_HASHES,
&bounds,
config.check_hash,
config.accounts_cache_and_ancestors,
config
.accounts_cache_and_ancestors
.map(|(a, b)| (a, b, &self.accounts_index)),
hash.filler_account_suffix.as_ref(),
)?;

View File

@ -1,8 +1,6 @@
use {
crate::{
accounts_cache::AccountsCache,
accounts_db::{AccountInfoAccountsIndex, SnapshotStorages},
ancestors::Ancestors,
accounts_cache::AccountsCache, accounts_db::SnapshotStorages, ancestors::Ancestors,
sorted_storages::SortedStorages,
},
log::*,
@ -30,11 +28,7 @@ pub struct CalcAccountsHashConfig<'a> {
pub use_bg_thread_pool: bool,
pub stats: HashStats,
pub check_hash: bool,
pub accounts_cache_and_ancestors: Option<(
&'a AccountsCache,
&'a Ancestors,
&'a AccountInfoAccountsIndex,
)>,
pub accounts_cache_and_ancestors: Option<(&'a AccountsCache, &'a Ancestors)>,
// to come soon
/*
pub rent_collector: RentCollector,