trie, les, tests, core: implement trie tracer (#24403)
Trie tracer is an auxiliary tool to capture all deleted nodes which can't be captured by trie.Committer. The deleted nodes can be removed from the disk later.
This commit is contained in:
@ -87,7 +87,7 @@ func (t *SecureTrie) TryGetNode(path []byte) ([]byte, int, error) {
|
||||
return t.trie.TryGetNode(path)
|
||||
}
|
||||
|
||||
// TryUpdate account will abstract the write of an account to the
|
||||
// TryUpdateAccount account will abstract the write of an account to the
|
||||
// secure trie.
|
||||
func (t *SecureTrie) TryUpdateAccount(key []byte, acc *types.StateAccount) error {
|
||||
hk := t.hashKey(key)
|
||||
@ -185,8 +185,10 @@ func (t *SecureTrie) Hash() common.Hash {
|
||||
|
||||
// Copy returns a copy of SecureTrie.
|
||||
func (t *SecureTrie) Copy() *SecureTrie {
|
||||
cpy := *t
|
||||
return &cpy
|
||||
return &SecureTrie{
|
||||
trie: *t.trie.Copy(),
|
||||
secKeyCache: t.secKeyCache,
|
||||
}
|
||||
}
|
||||
|
||||
// NodeIterator returns an iterator that returns nodes of the underlying trie. Iteration
|
||||
|
Reference in New Issue
Block a user