From d3ca364e9e41ebc1b37815eede685dd852901776 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Wed, 7 Sep 2022 13:11:00 -0700 Subject: [PATCH] reuse shared function (#27642) --- runtime/src/bank.rs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 52c047aa7..6106d8050 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -2285,19 +2285,6 @@ impl Bank { bank } - /// if we were to serialize THIS bank, what value should be saved for the prior accounts hash? - /// This depends on the proximity to the time to take the snapshot and the time to use the snapshot. - pub(crate) fn get_epoch_accounts_hash_to_serialize(&self) -> Option { - self.rc - .accounts - .accounts_db - .epoch_accounts_hash - .lock() - .unwrap() - .as_ref() - .map(|hash| *hash.as_ref()) - } - /// Return subset of bank fields representing serializable state pub(crate) fn get_fields_to_serialize<'a>( &'a self, @@ -7893,6 +7880,12 @@ impl Bank { total_accounts_stats } + /// if we were to serialize THIS bank, what value should be saved for the prior accounts hash? + /// This depends on the proximity to the time to take the snapshot and the time to use the snapshot. + pub(crate) fn get_epoch_accounts_hash_to_serialize(&self) -> Option { + self.epoch_accounts_hash().map(|hash| *hash.as_ref()) + } + /// Convenience fn to get the Epoch Accounts Hash fn epoch_accounts_hash(&self) -> Option { *self