Skip to content

Commit

Permalink
core/state: skip deleting storages for EmptyTrie (bnb-chain#1911)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBSC authored Oct 10, 2023
1 parent f843951 commit 17ffdf1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,10 @@ func (s *StateDB) deleteStorage(addr common.Address, addrHash common.Hash, root
if err != nil {
return false, nil, nil, fmt.Errorf("failed to open storage trie, err: %w", err)
}
// skip deleting storages for EmptyTrie
if _, ok := tr.(*trie.EmptyTrie); ok {
return false, nil, nil, nil
}
it, err := tr.NodeIterator(nil)
if err != nil {
return false, nil, nil, fmt.Errorf("failed to open storage iterator, err: %w", err)
Expand Down

0 comments on commit 17ffdf1

Please sign in to comment.