mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
trie/bintrie: wrap DeleteAccount error with address context
DeleteStorage, UpdateStorage, and UpdateContractCode all wrap the
underlying InsertValuesAtStem/Insert error with the offending
address ("(%x) error: %v"). UpdateAccount is the lone outlier and
DeleteAccount inherited that pattern. When InsertValuesAtStem fails
deep inside the recursion (e.g. a HashedNode resolver error),
"which address" is exactly the context the caller wants. Match
DeleteStorage, the closest sibling.
This commit is contained in:
parent
5befdfa928
commit
e1673c1622
1 changed files with 4 additions and 1 deletions
|
|
@ -331,7 +331,10 @@ func (t *BinaryTrie) DeleteAccount(addr common.Address) error {
|
|||
values[accountDeletedMarkerKey] = zeroBlob[:]
|
||||
|
||||
t.root, err = t.root.InsertValuesAtStem(stem, values, t.nodeResolver, 0)
|
||||
return err
|
||||
if err != nil {
|
||||
return fmt.Errorf("DeleteAccount (%x) error: %v", addr, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// accountDeletedMarkerKey is the stem offset used as a "this account was
|
||||
|
|
|
|||
Loading…
Reference in a new issue