Skip to content

Commit

Permalink
only update write_version if accounts notifier is some
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge committed Aug 28, 2024
1 parent de664e8 commit ae2284a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6812,9 +6812,12 @@ impl AccountsDb {
accounts_and_meta_to_store: &impl StorableAccounts<'b>,
txs: Option<&[&SanitizedTransaction]>,
) -> Vec<AccountInfo> {
let mut current_write_version = self
.write_version
.fetch_add(accounts_and_meta_to_store.len() as u64, Ordering::AcqRel);
let mut current_write_version = if self.accounts_update_notifier.is_some() {
self.write_version
.fetch_add(accounts_and_meta_to_store.len() as u64, Ordering::AcqRel)
} else {
0
};

let (account_infos, cached_accounts) = (0..accounts_and_meta_to_store.len())
.map(|index| {
Expand Down

0 comments on commit ae2284a

Please sign in to comment.