call StorableAccounts.pubkey once (#752)

This commit is contained in:
Jeff Washington (jwash) 2024-04-11 11:22:50 -05:00 committed by GitHub
parent d5c291a934
commit baed522d2b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 4 deletions

View File

@ -6405,19 +6405,18 @@ impl AccountsDb {
.account_default_if_zero_lamport(i)
.map(|account| account.to_account_shared_data())
.unwrap_or_default();
let pubkey = accounts_and_meta_to_store.pubkey(i);
let account_info = AccountInfo::new(StorageLocation::Cached, account.lamports());
self.notify_account_at_accounts_update(
slot,
&account,
txn,
accounts_and_meta_to_store.pubkey(i),
pubkey,
&mut write_version_producer,
);
let cached_account =
self.accounts_cache
.store(slot, accounts_and_meta_to_store.pubkey(i), account);
let cached_account = self.accounts_cache.store(slot, pubkey, account);
// hash this account in the bg
match &self.sender_bg_hasher {
Some(ref sender) => {