@@ -1654,18 +1654,17 @@ func (bc *BlockChain) insertChain(chain types.Blocks, verifySeals bool) (int, er
16541654 // If we have a followup block, run that against the current state to pre-cache
16551655 // transactions and probabilistically some of the account/storage trie nodes.
16561656 var followupInterrupt uint32
1657-
16581657 if ! bc .cacheConfig .TrieCleanNoPrefetch {
16591658 if followup , err := it .peek (); followup != nil && err == nil {
1660- go func ( start time. Time ) {
1661- throwaway , _ := state .New ( parent . Root , bc . stateCache )
1662- bc .prefetcher .Prefetch (followup , throwaway , bc .vmConfig , & followupInterrupt )
1659+ throwaway , _ := state . New ( parent . Root , bc . stateCache )
1660+ go func ( start time. Time , followup * types. Block , throwaway * state.StateDB , interrupt * uint32 ) {
1661+ bc .prefetcher .Prefetch (followup , throwaway , bc .vmConfig , interrupt )
16631662
16641663 blockPrefetchExecuteTimer .Update (time .Since (start ))
1665- if atomic .LoadUint32 (& followupInterrupt ) == 1 {
1664+ if atomic .LoadUint32 (interrupt ) == 1 {
16661665 blockPrefetchInterruptMeter .Mark (1 )
16671666 }
1668- }(time .Now ())
1667+ }(time .Now (), followup , throwaway , & followupInterrupt )
16691668 }
16701669 }
16711670 // Process block using the parent state as reference point
0 commit comments