allow hash calc to use all threads at startup (#25369)

This commit is contained in:
Jeff Washington (jwash) 2022-05-20 11:45:01 -05:00 committed by GitHub
parent 467431de89
commit 9ef0acdf5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -758,6 +758,7 @@ impl Accounts {
.collect())
}
/// only called at startup vs steady-state runtime
pub fn calculate_capitalization(
&self,
ancestors: &Ancestors,
@ -768,7 +769,7 @@ impl Accounts {
rent_collector: &RentCollector,
) -> u64 {
let use_index = false;
let is_startup = false; // there may be conditions where this is called at startup.
let is_startup = true;
self.accounts_db
.update_accounts_hash_with_index_option(
use_index,

View File

@ -6397,7 +6397,8 @@ impl Bank {
Ok(sanitized_tx)
}
pub fn calculate_capitalization(&self, debug_verify: bool) -> u64 {
/// only called at startup vs steady-state runtime
fn calculate_capitalization(&self, debug_verify: bool) -> u64 {
let can_cached_slot_be_unflushed = true; // implied yes
self.rc.accounts.calculate_capitalization(
&self.ancestors,
@ -6409,6 +6410,7 @@ impl Bank {
)
}
/// only called at startup vs steady-state runtime
pub fn calculate_and_verify_capitalization(&self, debug_verify: bool) -> bool {
let calculated = self.calculate_capitalization(debug_verify);
let expected = self.capitalization();