core/state: check err for iter.Error in fastDeleteStorage (#28122)

core/state: check err for iter.Error
pull/28126/head
Darioush Jalali 1 year ago committed by GitHub
parent 65a17c00c7
commit 48fdb79de5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      core/state/statedb.go

@ -973,7 +973,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))
@ -983,7 +983,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 {

Loading…
Cancel
Save