Skip to content

Commit 8a2edcb

Browse files
committed
core: only log slow block for single block insertion
1 parent 5c88299 commit 8a2edcb

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
@@ -1917,7 +1917,12 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness
19171917
return nil, it.index, err
19181918
}
19191919
res.stats.reportMetrics()
1920-
res.stats.logSlow(block, bc.slowBlockThreshold)
1920+
1921+
// Log slow block only if a single block is inserted (usually after the
1922+
// initial sync) to not overwhelm the users.
1923+
if len(chain) == 1 {
1924+
res.stats.logSlow(block, bc.slowBlockThreshold)
1925+
}
19211926

19221927
// Report the import stats before returning the various results
19231928
stats.processed++

0 commit comments

Comments
 (0)