core: write head hash to db after snap sync is complete

This commit is contained in:
Weixie Cui 2026-05-09 12:57:04 +08:00
parent 1abbae239d
commit 9a43073a1f

View file

@ -1186,6 +1186,7 @@ func (bc *BlockChain) SnapSyncComplete(hash common.Hash) error {
} }
// If all checks out, manually set the head block. // If all checks out, manually set the head block.
rawdb.WriteHeadBlockHash(bc.db, hash)
bc.currentBlock.Store(block.Header()) bc.currentBlock.Store(block.Header())
headBlockGauge.Update(int64(block.NumberU64())) headBlockGauge.Update(int64(block.NumberU64()))