core: initialize current block/fastblock atomics to nil (19352)

This commit is contained in:
Daniel Liu 2025-03-18 16:16:27 +08:00
parent a1d6e839c0
commit 3856e16d8c

View file

@ -267,6 +267,10 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par
return nil, ErrNoGenesis
}
var nilBlock *types.Block
bc.currentBlock.Store(nilBlock)
bc.currentFastBlock.Store(nilBlock)
// Update chain info data metrics
chainInfoGauge.Update(metrics.GaugeInfoValue{"chain_id": bc.chainConfig.ChainId.String()})