Skip to content

Commit

Permalink
Gracefully shutdown on evodb inconsistency instead of crashing (#2611)
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Jan 7, 2019
1 parent 07dcddb commit 0acfbf6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1616,9 +1616,9 @@ static DisconnectResult DisconnectBlock(const CBlock& block, CValidationState& s
bool fDIP0003Active = VersionBitsState(pindex->pprev, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0003, versionbitscache) == THRESHOLD_ACTIVE;
bool fHasBestBlock = evoDb->VerifyBestBlock(pindex->GetBlockHash());

if (fDIP0003Active) {
if (fDIP0003Active && !fHasBestBlock) {
// Nodes that upgraded after DIP3 activation will have to reindex to ensure evodb consistency
assert(fHasBestBlock);
AbortNode("Found EvoDB inconsistency, you must reindex to continue");
}

bool fClean = true;
Expand Down Expand Up @@ -1904,9 +1904,9 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
bool fDIP0003Active = VersionBitsState(pindex->pprev, Params().GetConsensus(), Consensus::DEPLOYMENT_DIP0003, versionbitscache) == THRESHOLD_ACTIVE;
bool fHasBestBlock = evoDb->VerifyBestBlock(pindex->pprev->GetBlockHash());

if (fDIP0003Active) {
if (fDIP0003Active && !fHasBestBlock) {
// Nodes that upgraded after DIP3 activation will have to reindex to ensure evodb consistency
assert(fHasBestBlock);
AbortNode("Found EvoDB inconsistency, you must reindex to continue");
}
}

Expand Down

0 comments on commit 0acfbf6

Please sign in to comment.