From a20e38720c239a8e62797ec0ff8ffbcb813b2300 Mon Sep 17 00:00:00 2001 From: s7v7nislands Date: Mon, 13 Mar 2023 16:02:50 +0800 Subject: [PATCH] core: minor code refactor (#26852) * core: refactor code * core: drop it from this anonymous goroutine func --- core/blockchain.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index f22562ccf..1fe7d73e0 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1740,14 +1740,14 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals, setHead bool) if followup, err := it.peek(); followup != nil && err == nil { throwaway, _ := state.New(parent.Root, bc.stateCache, bc.snaps) - go func(start time.Time, followup *types.Block, throwaway *state.StateDB, interrupt *uint32) { + go func(start time.Time, followup *types.Block, throwaway *state.StateDB) { bc.prefetcher.Prefetch(followup, throwaway, bc.vmConfig, &followupInterrupt) blockPrefetchExecuteTimer.Update(time.Since(start)) - if atomic.LoadUint32(interrupt) == 1 { + if atomic.LoadUint32(&followupInterrupt) == 1 { blockPrefetchInterruptMeter.Mark(1) } - }(time.Now(), followup, throwaway, &followupInterrupt) + }(time.Now(), followup, throwaway) } }