Skip to content

Commit

Permalink
fix: active verify loop
Browse files Browse the repository at this point in the history
  • Loading branch information
joeylichang committed Dec 6, 2024
1 parent 91a1b4c commit 8f5ac08
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis
if txLookupLimit != nil {
bc.txIndexer = newTxIndexer(*txLookupLimit, bc)
}
go bc.VerifyLoop()
return bc, nil
}

Expand Down Expand Up @@ -2316,6 +2317,13 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
blockExecutionTimer.Update(ptime - trieRead) // The time spent on EVM processing
blockValidationTimer.Update(vtime - (triehash + trieUpdate)) // The time spent on block validation

err = bc.writeBlockWithState(block, receipts, statedb)
if err != nil {
log.Crit("Failed to write block", "number", block.Number(), "hash", block.Hash(), "err", err)
}
//}
//return it.index, err

// Write the block to the chain and get the status.
var (
wstart = time.Now()
Expand Down Expand Up @@ -2430,6 +2438,7 @@ func (bc *BlockChain) VerifyLoop() {
if err := bc.commitState(task.block, task.receipts, task.state); err != nil {
log.Crit("commit state failed", "error", err)
}
//status, err = bc.writeBlockAndSetHead(task.block, task.receipts, task.logs, task.state, false)
}
}
}
Expand Down

0 comments on commit 8f5ac08

Please sign in to comment.