Skip to content

Commit

Permalink
Merge pull request #251 from OffchainLabs/delete-storage-return-error
Browse files Browse the repository at this point in the history
Immediately return an error from updateTrie if DeleteStorage fails
  • Loading branch information
Tristan-Wilson authored Aug 30, 2023
2 parents 9a31b62 + 92c20a9 commit 11e7b08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/state/state_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,10 @@ func (s *stateObject) updateTrie(db Database) (Trie, error) {
if len(keysToDelete) > 0 {
sort.Slice(keysToDelete, func(i, j int) bool { return bytes.Compare(keysToDelete[i][:], keysToDelete[j][:]) < 0 })
for _, key := range keysToDelete {
s.db.setError(tr.DeleteStorage(s.address, key[:]))
if err := tr.DeleteStorage(s.address, key[:]); err != nil {
s.db.setError(err)
return nil, err
}
s.db.StorageDeleted += 1
}
}
Expand Down

0 comments on commit 11e7b08

Please sign in to comment.