From fb95fa68a2ef01eda1151d5004bd519c5dac931c Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Mon, 31 Jan 2022 11:39:23 -0600 Subject: [PATCH] cleanup api (#22845) --- ledger/src/blockstore_processor.rs | 1 - runtime/src/accounts_background_service.rs | 3 +-- runtime/src/bank.rs | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ledger/src/blockstore_processor.rs b/ledger/src/blockstore_processor.rs index ba48d02c0..12ee159c7 100644 --- a/ledger/src/blockstore_processor.rs +++ b/ledger/src/blockstore_processor.rs @@ -1248,7 +1248,6 @@ fn load_frozen_forks( new_root_bank.update_accounts_hash_with_index_option( snapshot_config.accounts_hash_use_index, snapshot_config.accounts_hash_debug_verify, - Some(new_root_bank.epoch_schedule().slots_per_epoch), false, ); snapshot_utils::snapshot_bank( diff --git a/runtime/src/accounts_background_service.rs b/runtime/src/accounts_background_service.rs index 33770dab0..e51fa7749 100644 --- a/runtime/src/accounts_background_service.rs +++ b/runtime/src/accounts_background_service.rs @@ -111,7 +111,7 @@ impl SnapshotRequestHandler { let previous_hash = if test_hash_calculation { // We have to use the index version here. // We cannot calculate the non-index way because cache has not been flushed and stores don't match reality. - snapshot_root_bank.update_accounts_hash_with_index_option(true, false, None, false) + snapshot_root_bank.update_accounts_hash_with_index_option(true, false, false) } else { Hash::default() }; @@ -149,7 +149,6 @@ impl SnapshotRequestHandler { let this_hash = snapshot_root_bank.update_accounts_hash_with_index_option( use_index_hash_calculation, test_hash_calculation, - Some(snapshot_root_bank.epoch_schedule().slots_per_epoch), false, ); let hash_for_testing = if test_hash_calculation { diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 80d50e92b..360403d46 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -5755,9 +5755,9 @@ impl Bank { &self, use_index: bool, mut debug_verify: bool, - slots_per_epoch: Option, is_startup: bool, ) -> Hash { + let slots_per_epoch = Some(self.epoch_schedule().slots_per_epoch); let (hash, total_lamports) = self .rc .accounts @@ -5810,7 +5810,7 @@ impl Bank { } pub fn update_accounts_hash(&self) -> Hash { - self.update_accounts_hash_with_index_option(true, false, None, false) + self.update_accounts_hash_with_index_option(true, false, false) } /// A snapshot bank should be purged of 0 lamport accounts which are not part of the hash