From 074095b1d5df91eb968856280197cc71de7ac052 Mon Sep 17 00:00:00 2001 From: JukLee0ira Date: Wed, 7 Aug 2024 11:39:57 +0800 Subject: [PATCH] core: fix writeBlock --- core/blockchain.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/blockchain.go b/core/blockchain.go index e6aedc143c39..f3cf58bdcc0b 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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