Fix devnet genesis check in InitBlockIndex() (#2805)
This commit is contained in:
parent
4d8ef35120
commit
81eeff1c54
@ -4172,8 +4172,10 @@ bool InitBlockIndex(const CChainParams& chainparams)
|
|||||||
if (chainparams.NetworkIDString() == CBaseChainParams::DEVNET) {
|
if (chainparams.NetworkIDString() == CBaseChainParams::DEVNET) {
|
||||||
// We can't continue if devnet genesis block is invalid
|
// We can't continue if devnet genesis block is invalid
|
||||||
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(chainparams.DevNetGenesisBlock());
|
std::shared_ptr<const CBlock> shared_pblock = std::make_shared<const CBlock>(chainparams.DevNetGenesisBlock());
|
||||||
bool fProcessDevnetGenesisBlock = ProcessNewBlock(chainparams, shared_pblock, true, NULL);
|
bool fCheckBlock = CheckBlock(*shared_pblock, state, chainparams.GetConsensus());
|
||||||
assert(fProcessDevnetGenesisBlock);
|
assert(fCheckBlock);
|
||||||
|
if (!AcceptBlock(shared_pblock, state, chainparams, NULL, true, NULL, NULL))
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Force a chainstate write so that when we VerifyDB in a moment, it doesn't check stale data
|
// Force a chainstate write so that when we VerifyDB in a moment, it doesn't check stale data
|
||||||
|
Loading…
Reference in New Issue
Block a user