Skip to content

Commit

Permalink
perf: insertChain skip report snapshot size if in miner mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoieh committed Nov 8, 2024
1 parent a830915 commit 847dd36
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2024,13 +2024,11 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
stats.usedGas += usedGas

var snapDiffItems, snapBufItems common.StorageSize
if bc.snaps != nil {
if bc.snaps != nil && !minerMode {
snapDiffItems, snapBufItems = bc.snaps.Size()
}

var trieDiffNodes common.StorageSize = 0
var trieBufNodes common.StorageSize = 0
var trieImmutableBufNodes common.StorageSize = 0
var trieDiffNodes, trieBufNodes, trieImmutableBufNodes common.StorageSize
if !minerMode {
trieDiffNodes, trieBufNodes, trieImmutableBufNodes, _ = bc.triedb.Size()
}
Expand Down

0 comments on commit 847dd36

Please sign in to comment.