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"
  • Loading branch information
furszy committed Apr 3, 2021
1 parent a51a755 commit f68251d
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 f68251d

Please sign in to comment.