Skip to content

Commit a20e387

Browse files
authored
core: minor code refactor (#26852)
* core: refactor code * core: drop it from this anonymous goroutine func
1 parent ca61048 commit a20e387

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/blockchain.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,14 +1740,14 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals, setHead bool)
17401740
if followup, err := it.peek(); followup != nil && err == nil {
17411741
throwaway, _ := state.New(parent.Root, bc.stateCache, bc.snaps)
17421742

1743-
go func(start time.Time, followup *types.Block, throwaway *state.StateDB, interrupt *uint32) {
1743+
go func(start time.Time, followup *types.Block, throwaway *state.StateDB) {
17441744
bc.prefetcher.Prefetch(followup, throwaway, bc.vmConfig, &followupInterrupt)
17451745

17461746
blockPrefetchExecuteTimer.Update(time.Since(start))
1747-
if atomic.LoadUint32(interrupt) == 1 {
1747+
if atomic.LoadUint32(&followupInterrupt) == 1 {
17481748
blockPrefetchInterruptMeter.Mark(1)
17491749
}
1750-
}(time.Now(), followup, throwaway, &followupInterrupt)
1750+
}(time.Now(), followup, throwaway)
17511751
}
17521752
}
17531753

0 commit comments

Comments
 (0)