|
|
|
@ -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);
|
|
|
|
|