reuse shared function (#27642)
This commit is contained in:
parent
c04747dd66
commit
d3ca364e9e
|
@ -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<Hash> {
|
||||
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<Hash> {
|
||||
self.epoch_accounts_hash().map(|hash| *hash.as_ref())
|
||||
}
|
||||
|
||||
/// Convenience fn to get the Epoch Accounts Hash
|
||||
fn epoch_accounts_hash(&self) -> Option<EpochAccountsHash> {
|
||||
*self
|
||||
|
|
Loading…
Reference in New Issue