From c89bd0d6a4865728c01f78b65299396aa8bfdeeb Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Tue, 18 Oct 2022 15:05:32 -0700 Subject: [PATCH] make ancient shrink consistent with shrink (#28457) --- runtime/src/accounts_db.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index db6409d990..ee1bfc7675 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -4304,7 +4304,7 @@ impl AccountsDb { let LoadAccountsIndexForShrink { alive_total, mut alive_accounts, - unrefed_pubkeys, + mut unrefed_pubkeys, } = self.load_accounts_index_for_shrink(stored_accounts); // collect @@ -4315,7 +4315,7 @@ impl AccountsDb { unrefed_pubkeys_collect .lock() .unwrap() - .push(unrefed_pubkeys); + .append(&mut unrefed_pubkeys); alive_total_collect.fetch_add(alive_total, Ordering::Relaxed); }); }); @@ -4421,10 +4421,7 @@ impl AccountsDb { ); if !all_are_zero_lamports { - self.add_uncleaned_pubkeys_after_shrink( - slot, - unrefed_pubkeys.into_iter().flatten().cloned(), - ); + self.add_uncleaned_pubkeys_after_shrink(slot, unrefed_pubkeys.into_iter().cloned()); } start.stop();