Skip to content

Commit

Permalink
core: fix writeBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
JukLee0ira authored and gzliudan committed Aug 7, 2024
1 parent 52077f1 commit 074095b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,9 @@ func (bc *BlockChain) insert(block *types.Block, writeBlock bool) {
// Add the block to the canonical chain number scheme and mark as the head
rawdb.WriteCanonicalHash(bc.db, block.Hash(), block.NumberU64())
rawdb.WriteHeadBlockHash(bc.db, block.Hash())
rawdb.WriteBlock(bc.db, block)
if writeBlock {
rawdb.WriteBlock(bc.db, block)
}
bc.currentBlock.Store(block)

// save cache BlockSigners
Expand Down

0 comments on commit 074095b

Please sign in to comment.