Skip to content

Commit

Permalink
Validation: rename one of the two instances using "bad-prevblk" to it…
Browse files Browse the repository at this point in the history
…s correct description of "prevblk-not-found"

Github-Pull: #2290
Rebased-From: f68251d
  • Loading branch information
furszy committed Apr 8, 2021
1 parent 39f6eaf commit c4dd07f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2949,8 +2949,10 @@ bool GetPrevIndex(const CBlock& block, CBlockIndex** pindexPrevRet, CValidationS
pindexPrev = nullptr;
if (block.GetHash() != Params().GetConsensus().hashGenesisBlock) {
BlockMap::iterator mi = mapBlockIndex.find(block.hashPrevBlock);
if (mi == mapBlockIndex.end())
return state.DoS(0, error("%s : prev block %s not found", __func__, block.hashPrevBlock.GetHex()), 0, "bad-prevblk");
if (mi == mapBlockIndex.end()) {
return state.DoS(0, error("%s : prev block %s not found", __func__, block.hashPrevBlock.GetHex()), 0,
"prevblk-not-found");
}
pindexPrev = (*mi).second;
if (pindexPrev->nStatus & BLOCK_FAILED_MASK) {
//If this "invalid" block is an exact match from the checkpoints, then reconsider it
Expand Down

0 comments on commit c4dd07f

Please sign in to comment.