Update blockchain.go

optimism 'if'
This commit is contained in:
Marcel 2025-05-02 12:41:08 +08:00 committed by GitHub
parent 701df4baad
commit 6b8bebd3b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1856,7 +1856,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool, makeWitness
// If we have a followup block, run that against the current state to pre-cache
// transactions and probabilistically some of the account/storage trie nodes.
var followupInterrupt atomic.Bool
if !bc.cacheConfig.TrieCleanNoPrefetch {
if !bc.cacheConfig.TrieCleanNoPrefetch && block.Transactions().Len() > 0 {
if followup, err := it.peek(); followup != nil && err == nil {
throwaway, _ := state.New(parent.Root, bc.statedb)