From 3412928cad31bc24ad81f17cc98965c0eaba1ee5 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Thu, 12 Jan 2023 09:17:18 -0600 Subject: [PATCH] get_slot_stores -> get_slot_storage_entry (#29678) --- runtime/src/accounts_db.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 28de36ad6..efc87cbc3 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -8282,13 +8282,15 @@ impl AccountsDb { self.accounts_cache.add_root(slot); cache_time.stop(); let mut store_time = Measure::start("store_add_root"); - // We would not expect this slot to be shrinking right now. + // We would not expect this slot to be shrinking right now, but other slots may be. // But, even if it was, we would just mark a store id as dirty unnecessarily and that is ok. // So, allow shrinking to be in progress. - if let Some(slot_stores) = self.storage.get_slot_stores_shrinking_in_progress_ok(slot) { - for (store_id, store) in slot_stores.read().unwrap().iter() { - self.dirty_stores.insert((slot, *store_id), store.clone()); - } + if let Some(store) = self + .storage + .get_slot_storage_entry_shrinking_in_progress_ok(slot) + { + self.dirty_stores + .insert((slot, store.append_vec_id()), store); } store_time.stop();