diff --git a/runtime/src/in_mem_accounts_index.rs b/runtime/src/in_mem_accounts_index.rs index b252499267ba4b..9f980f0f767d08 100644 --- a/runtime/src/in_mem_accounts_index.rs +++ b/runtime/src/in_mem_accounts_index.rs @@ -279,7 +279,7 @@ impl InMemAccountsIndex { m.stop(); callback(if let Some(entry) = result { - entry.set_age(self.storage.future_age_to_flush()); + self.set_age_to_future(entry); Some(entry) } else { drop(map); @@ -305,6 +305,10 @@ impl InMemAccountsIndex { self.get_internal(pubkey, |entry| (true, entry.map(Arc::clone))) } + fn set_age_to_future(&self, entry: &AccountMapEntry) { + entry.set_age(self.storage.future_age_to_flush()); + } + /// lookup 'pubkey' in index (in_mem or disk). /// call 'callback' whether found or not pub(crate) fn get_internal( @@ -474,7 +478,7 @@ impl InMemAccountsIndex { reclaims, reclaim, ); - current.set_age(self.storage.future_age_to_flush()); + self.set_age_to_future(current); } Entry::Vacant(vacant) => { // not in cache, look on disk