Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensures duplicates_lt_hash is Some if accounts lt hash is enabled #3534

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9009,6 +9009,14 @@ impl AccountsDb {

self.accounts_index.log_secondary_indexes();

// The duplicates lt hash must be Some if should_calculate_duplicates_lt_hash is true.
// But, if there were no duplicates, then we'd never set outer_duplicates_lt_hash to Some!
// So do one last check here to ensure outer_duplicates_lt_hash is Some if we're supposed
// to calculate the duplicates lt hash.
if should_calculate_duplicates_lt_hash && outer_duplicates_lt_hash.is_none() {
outer_duplicates_lt_hash = Some(Box::new(DuplicatesLtHash::default()));
}

IndexGenerationInfo {
accounts_data_len: accounts_data_len.load(Ordering::Relaxed),
rent_paying_accounts_by_partition: rent_paying_accounts_by_partition
Expand Down
Loading