mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 05:36:46 +00:00
core: only log slow block for single block insertion
This commit is contained in:
parent
72bd59eeab
commit
49b0050d18
1 changed files with 6 additions and 1 deletions
|
|
@ -1922,7 +1922,12 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness
|
||||||
return nil, it.index, err
|
return nil, it.index, err
|
||||||
}
|
}
|
||||||
res.stats.reportMetrics()
|
res.stats.reportMetrics()
|
||||||
|
|
||||||
|
// Log slow block only if a single block is inserted (usually after the
|
||||||
|
// initial sync) to not overwhelm the users.
|
||||||
|
if len(chain) == 1 {
|
||||||
res.stats.logSlow(block, bc.slowBlockThreshold)
|
res.stats.logSlow(block, bc.slowBlockThreshold)
|
||||||
|
}
|
||||||
|
|
||||||
// Report the import stats before returning the various results
|
// Report the import stats before returning the various results
|
||||||
stats.processed++
|
stats.processed++
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue