From 6622f53c41c1e67415b4f262ef98df2068475b6b Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 9 Aug 2023 16:33:55 +0200 Subject: [PATCH] fix(trie): account prefixset unwind (#4130) Co-authored-by: Roman Krasiuk --- crates/storage/provider/src/providers/database/provider.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/storage/provider/src/providers/database/provider.rs b/crates/storage/provider/src/providers/database/provider.rs index 5c9bedc410..2f122fbe23 100644 --- a/crates/storage/provider/src/providers/database/provider.rs +++ b/crates/storage/provider/src/providers/database/provider.rs @@ -1779,9 +1779,8 @@ impl<'this, TX: DbTxMut<'this> + DbTx<'this>> BlockExecutionWriter for DatabaseP // Unwind account hashes. Add changed accounts to account prefix set. let hashed_addresses = self.unwind_account_hashing(range.clone())?; for (hashed_address, account) in hashed_addresses { - if account.is_some() { - account_prefix_set.insert(Nibbles::unpack(hashed_address)); - } else { + account_prefix_set.insert(Nibbles::unpack(hashed_address)); + if account.is_none() { destroyed_accounts.insert(hashed_address); } }