trie: don't reset tracer at the end of Commit (#30024)

* trie: don't reset tracer at the end of Commit

* Update trie.go

---------

Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
pull/30026/head
jwasinger 5 months ago committed by GitHub
parent 67a862db9d
commit 0e3a0a693c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      trie/trie.go

@ -53,7 +53,6 @@ type Trie struct {
reader *trieReader reader *trieReader
// tracer is the tool to track the trie changes. // tracer is the tool to track the trie changes.
// It will be reset after each commit operation.
tracer *tracer tracer *tracer
} }
@ -609,7 +608,6 @@ func (t *Trie) Hash() common.Hash {
// Once the trie is committed, it's not usable anymore. A new trie must // Once the trie is committed, it's not usable anymore. A new trie must
// be created with new root and updated trie database for following usage // be created with new root and updated trie database for following usage
func (t *Trie) Commit(collectLeaf bool) (common.Hash, *trienode.NodeSet) { func (t *Trie) Commit(collectLeaf bool) (common.Hash, *trienode.NodeSet) {
defer t.tracer.reset()
defer func() { defer func() {
t.committed = true t.committed = true
}() }()

Loading…
Cancel
Save