From d23e74c501caa8852d023abaf501ab5beb67de7a Mon Sep 17 00:00:00 2001 From: Zsolt Felfoldi Date: Thu, 23 Jan 2025 06:25:58 +0100 Subject: [PATCH] core: update blockProcFeed in insertChain --- core/blockchain.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 6aac541ba0..3a540ab99c 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1577,8 +1577,6 @@ func (bc *BlockChain) InsertChain(chain types.Blocks) (int, error) { if len(chain) == 0 { return 0, nil } - bc.blockProcFeed.Send(true) - defer bc.blockProcFeed.Send(false) // Do a sanity check that the provided chain is actually ordered and linked. for i := 1; i < len(chain); i++ { @@ -1618,6 +1616,9 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness if bc.insertStopped() { return nil, 0, nil } + bc.blockProcFeed.Send(true) + defer bc.blockProcFeed.Send(false) + // Start a parallel signature recovery (signer will fluke on fork transition, minimal perf loss) SenderCacher().RecoverFromBlocks(types.MakeSigner(bc.chainConfig, chain[0].Number(), chain[0].Time()), chain)