core/state, trie, light: add a TryDeleteAccount method (#25531)
* core/state, trie, light: Add a DeleteAccount method * review feedback * Update database.go * pr triage feedback Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
This commit is contained in:
co-authored by
rjl493456442
parent
12185e40e0
commit
6da5c1644d
@@ -189,6 +189,13 @@ func (t *StateTrie) TryDelete(key []byte) error {
|
||||
return t.trie.TryDelete(hk)
|
||||
}
|
||||
|
||||
// TryDeleteACcount abstracts an account deletion from the trie.
|
||||
func (t *StateTrie) TryDeleteAccount(key []byte) error {
|
||||
hk := t.hashKey(key)
|
||||
delete(t.getSecKeyCache(), string(hk))
|
||||
return t.trie.TryDelete(hk)
|
||||
}
|
||||
|
||||
// GetKey returns the sha3 preimage of a hashed key that was
|
||||
// previously used to store a value.
|
||||
func (t *StateTrie) GetKey(shaKey []byte) []byte {
|
||||
|
||||
Reference in New Issue
Block a user