Skip to content

Commit

Permalink
in get_pubkey_hash_account_for_slot use take_account earlier (anza-xy…
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington authored Apr 9, 2024
1 parent 4546e79 commit 9d700b8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7605,13 +7605,12 @@ impl AccountsDb {
loaded_account: LoadedAccount| {
// Storage may have duplicates so only keep the latest version for each key
let mut loaded_hash = loaded_account.loaded_hash();
let key = *loaded_account.pubkey();
let account = loaded_account.take_account();
if loaded_hash == AccountHash(Hash::default()) {
loaded_hash = Self::hash_account(&loaded_account, loaded_account.pubkey())
loaded_hash = Self::hash_account(&account, &key)
}
accum.insert(
*loaded_account.pubkey(),
(loaded_hash, loaded_account.take_account()),
);
accum.insert(key, (loaded_hash, account));
},
);

Expand Down

0 comments on commit 9d700b8

Please sign in to comment.