From ab6197b2ae3d327707e6ee75db4854cc09b4dfb0 Mon Sep 17 00:00:00 2001 From: brooks Date: Thu, 7 Nov 2024 17:48:01 -0500 Subject: [PATCH] Ensures duplicates_lt_hash is always Some --- accounts-db/src/accounts_db.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 831015746b0ab8..8d35f1f1f05bbd 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -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