Skip to content

Commit

Permalink
core: minor code refactor (#26852)
Browse files Browse the repository at this point in the history
* core: refactor code

* core: drop it from this anonymous goroutine func
  • Loading branch information
s7v7nislands committed Mar 13, 2023
1 parent ca61048 commit a20e387
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit a20e387

Please sign in to comment.