From 81eeff1c546a5e9abb25780fb918902143850ce4 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Mon, 25 Mar 2019 18:32:48 +0300 Subject: [PATCH] Fix devnet genesis check in InitBlockIndex() (#2805) --- src/validation.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index 740ae31c5..752bf4cf5 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4172,8 +4172,10 @@ bool InitBlockIndex(const CChainParams& chainparams) if (chainparams.NetworkIDString() == CBaseChainParams::DEVNET) { // We can't continue if devnet genesis block is invalid std::shared_ptr shared_pblock = std::make_shared(chainparams.DevNetGenesisBlock()); - bool fProcessDevnetGenesisBlock = ProcessNewBlock(chainparams, shared_pblock, true, NULL); - assert(fProcessDevnetGenesisBlock); + bool fCheckBlock = CheckBlock(*shared_pblock, state, chainparams.GetConsensus()); + 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