From d3a6f9a19ef4c0620a5c4f3c25f1b52057cd912b Mon Sep 17 00:00:00 2001 From: Darioush Jalali Date: Thu, 14 Sep 2023 23:09:07 -0700 Subject: [PATCH] core/state: check err for iter.Error in fastDeleteStorage (#28122) core/state: check err for iter.Error --- core/state/statedb.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index 0d7fc933626b..8c1b7eaea0d6 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1372,7 +1372,7 @@ func (s *StateDB) fastDeleteStorage(addrHash common.Hash, root common.Hash) (boo return true, size, nil, nil, nil } slot := common.CopyBytes(iter.Slot()) - if iter.Error() != nil { // error might occur after Slot function + if err := iter.Error(); err != nil { // error might occur after Slot function return false, 0, nil, nil, err } size += common.StorageSize(common.HashLength + len(slot)) @@ -1382,7 +1382,7 @@ func (s *StateDB) fastDeleteStorage(addrHash common.Hash, root common.Hash) (boo return false, 0, nil, nil, err } } - if iter.Error() != nil { // error might occur during iteration + if err := iter.Error(); err != nil { // error might occur during iteration return false, 0, nil, nil, err } if stack.Hash() != root {