Skip to content

Commit

Permalink
fix: commit and calc num
Browse files Browse the repository at this point in the history
  • Loading branch information
joeylichang committed Sep 26, 2024
1 parent 53b585e commit 2a6bb87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,9 @@ func (s *StateDB) AccountsIntermediateRoot() {
wg.Add(1)
tasks <- func() {
obj.updateRoot()
calcStateObjectCount.Add(1)
if obj.trie != nil {
calcStateObjectCount.Add(1)
}
// Cache the data until commit. Note, this update mechanism is not symmetric
// to the deletion, because whereas it is enough to track account updates
// at commit time, deletions need tracking at transaction boundary level to
Expand Down Expand Up @@ -1633,7 +1635,9 @@ func (s *StateDB) Commit(block uint64, failPostCommitFunc func(), postCommitFunc
taskResults <- taskResult{err, nil}
return
} else {
committedStateObjectNum.Add(1)
if obj.trie != nil {
committedStateObjectNum.Add(1)
}
taskResults <- taskResult{nil, set}
}
} else {
Expand Down

0 comments on commit 2a6bb87

Please sign in to comment.