Skip to content

Commit

Permalink
fix: update different error log info
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjunLi committed Jun 11, 2024
1 parent 55f884c commit 78702d0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -1305,14 +1305,13 @@ func (bc *BlockChain) writeHeadBlock(block *types.Block) {
defer bc.dbWg.Done()
// Add the block to the canonical chain number scheme and mark as the head
blockBatch := bc.db.BlockStore().NewBatch()

rawdb.WriteCanonicalHash(blockBatch, block.Hash(), block.NumberU64())
rawdb.WriteHeadHeaderHash(blockBatch, block.Hash())
rawdb.WriteHeadBlockHash(blockBatch, block.Hash())
rawdb.WriteHeadFastBlockHash(blockBatch, block.Hash())
// Flush the whole batch into the disk, exit the node if failed
if err := blockBatch.Write(); err != nil {
log.Crit("Failed to update chain indexes and markers", "err", err)
log.Crit("Failed to update chain indexes and markers in block db", "err", err)
}
}()
go func() {
Expand All @@ -1323,7 +1322,7 @@ func (bc *BlockChain) writeHeadBlock(block *types.Block) {

// Flush the whole batch into the disk, exit the node if failed
if err := batch.Write(); err != nil {
log.Crit("Failed to update chain indexes and markers", "err", err)
log.Crit("Failed to update chain indexes in chain db", "err", err)
}
}()

Expand Down

0 comments on commit 78702d0

Please sign in to comment.