mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 10:20:44 +00:00
Merge pull request #918 from gzliudan/fix-issue-19286
core: initialize current block/fastblock atomics to nil
This commit is contained in:
commit
b293363f0e
1 changed files with 4 additions and 0 deletions
|
|
@ -267,6 +267,10 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, chainConfig *par
|
||||||
return nil, ErrNoGenesis
|
return nil, ErrNoGenesis
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var nilBlock *types.Block
|
||||||
|
bc.currentBlock.Store(nilBlock)
|
||||||
|
bc.currentFastBlock.Store(nilBlock)
|
||||||
|
|
||||||
// Update chain info data metrics
|
// Update chain info data metrics
|
||||||
chainInfoGauge.Update(metrics.GaugeInfoValue{"chain_id": bc.chainConfig.ChainId.String()})
|
chainInfoGauge.Update(metrics.GaugeInfoValue{"chain_id": bc.chainConfig.ChainId.String()})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue