From 49b0050d18bfa3d150a2ceb54ec5c314e15baf00 Mon Sep 17 00:00:00 2001 From: Gary Rong Date: Thu, 9 Oct 2025 09:53:18 +0800 Subject: [PATCH] core: only log slow block for single block insertion --- core/blockchain.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/blockchain.go b/core/blockchain.go index 70a23c583d..4f4d841cb7 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1922,7 +1922,12 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness return nil, it.index, err } res.stats.reportMetrics() - res.stats.logSlow(block, bc.slowBlockThreshold) + + // 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) + } // Report the import stats before returning the various results stats.processed++