mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-13 10:21:37 +00:00
DeleteAccount was assigning t.root unconditionally and then returning the error, matching UpdateAccount but diverging from the safer pattern in UpdateStorage/DeleteStorage (assign to a temp, return on error, mutate t.root only on success). This is a partial fix to a broader footgun: InternalNode.Insert- ValuesAtStem mutates its receiver in place on error paths, so the root pointer is already shared and the mutation has already leaked by the time we return. The proper fix is either rewriting that function or documenting the contract; both are out of scope here. At minimum, stop pointing t.root at whatever InsertValuesAtStem returned on error (which could be nil or a different node altogether), and bring DeleteAccount in line with its DeleteStorage sibling. |
||
|---|---|---|
| .. | ||
| binary_node.go | ||
| binary_node_test.go | ||
| empty.go | ||
| empty_test.go | ||
| hashed_node.go | ||
| hashed_node_test.go | ||
| hasher.go | ||
| internal_node.go | ||
| internal_node_test.go | ||
| iterator.go | ||
| iterator_test.go | ||
| key_encoding.go | ||
| stem_node.go | ||
| stem_node_test.go | ||
| trie.go | ||
| trie_test.go | ||