diff options
author | Carl Dong <contact@carldong.me> | 2020-10-06 16:13:50 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-03-03 14:49:30 -0500 |
commit | 03f75c42e12a272057adccb6f0077e71f971eeef (patch) | |
tree | e762312697c3633a1b821a24923e7f5590839e1f | |
parent | 5e4af773809415b71a10e3120cc44854d61c4c19 (diff) |
validation: Use existing chain member in CChainState::LoadGenesisBlock
-rw-r--r-- | src/validation.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index b40e1f53b9..e1cd97a38e 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4629,9 +4629,10 @@ bool CChainState::LoadGenesisBlock(const CChainParams& chainparams) if (m_blockman.m_block_index.count(chainparams.GenesisBlock().GetHash())) return true; + assert(std::addressof(::ChainActive()) == std::addressof(m_chain)); try { const CBlock& block = chainparams.GenesisBlock(); - FlatFilePos blockPos = SaveBlockToDisk(block, 0, ::ChainActive(), chainparams, nullptr); + FlatFilePos blockPos = SaveBlockToDisk(block, 0, m_chain, chainparams, nullptr); if (blockPos.IsNull()) return error("%s: writing genesis block to disk failed", __func__); CBlockIndex *pindex = m_blockman.AddToBlockIndex(block); |