Skip to content

Commit 5c6a9fa

Browse files
committed
core: fix writeBlock
1 parent 52077f1 commit 5c6a9fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/blockchain.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,9 @@ func (bc *BlockChain) insert(block *types.Block, writeBlock bool) {
684684
// Add the block to the canonical chain number scheme and mark as the head
685685
rawdb.WriteCanonicalHash(bc.db, block.Hash(), block.NumberU64())
686686
rawdb.WriteHeadBlockHash(bc.db, block.Hash())
687-
rawdb.WriteBlock(bc.db, block)
687+
if writeBlock {
688+
rawdb.WriteBlock(bc.db, block)
689+
}
688690
bc.currentBlock.Store(block)
689691

690692
// save cache BlockSigners

0 commit comments

Comments
 (0)