Skip to content

Commit 1894279

Browse files
committed
core: only log slow block for single block insertion
1 parent 49f10c5 commit 1894279

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/blockchain.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,12 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness
19221922
return nil, it.index, err
19231923
}
19241924
res.stats.reportMetrics()
1925-
res.stats.logSlow(block, bc.slowBlockThreshold)
1925+
1926+
// Log slow block only if a single block is inserted (usually after the
1927+
// initial sync) to not overwhelm the users.
1928+
if len(chain) == 1 {
1929+
res.stats.logSlow(block, bc.slowBlockThreshold)
1930+
}
19261931

19271932
// Report the import stats before returning the various results
19281933
stats.processed++

0 commit comments

Comments
 (0)