mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
core: fix writeBlock
This commit is contained in:
parent
52077f18f3
commit
074095b1d5
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
// Add the block to the canonical chain number scheme and mark as the head
|
||||||
rawdb.WriteCanonicalHash(bc.db, block.Hash(), block.NumberU64())
|
rawdb.WriteCanonicalHash(bc.db, block.Hash(), block.NumberU64())
|
||||||
rawdb.WriteHeadBlockHash(bc.db, block.Hash())
|
rawdb.WriteHeadBlockHash(bc.db, block.Hash())
|
||||||
|
if writeBlock {
|
||||||
rawdb.WriteBlock(bc.db, block)
|
rawdb.WriteBlock(bc.db, block)
|
||||||
|
}
|
||||||
bc.currentBlock.Store(block)
|
bc.currentBlock.Store(block)
|
||||||
|
|
||||||
// save cache BlockSigners
|
// save cache BlockSigners
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue