Skip to content

Commit

Permalink
core: update blockProcFeed in insertChain
Browse files Browse the repository at this point in the history
  • Loading branch information
zsfelfoldi committed Jan 23, 2025
1 parent a840e9b commit 1b79e9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++ {
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 1b79e9d

Please sign in to comment.