Skip to content

Commit

Permalink
Remove unused code and add null check.
Browse files Browse the repository at this point in the history
Github-Merge: PIVX-Project#405
Rebased-From: 3eabaa2
  • Loading branch information
presstab authored and Fuzzbawls committed Nov 29, 2017
1 parent 76a7e0f commit fdaea40
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions src/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,6 @@ bool CheckBlock(int nHeight, const uint256& hash, bool fMatchesCheckpoint)
return hash == i->second;
}

//! Returns true only when both the height and hash match a checkpoint
bool IsCheckpointedBlock(int nHeight, const uint256& hash)
{
const MapCheckpoints& checkpoints = *Params().Checkpoints().mapCheckpoints;
MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
if (i == checkpoints.end()) return false;
return hash == i->second;
}

//! Guess how far we are in the verification process at the given block index
double GuessVerificationProgress(CBlockIndex* pindex, bool fSigchecks)
{
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4716,7 +4716,7 @@ bool AcceptBlockHeader(const CBlock& block, CValidationState& state, CBlockIndex
pindexPrev = (*mi).second;
if (pindexPrev->nStatus & BLOCK_FAILED_MASK) {
//If this "invalid" block is an exact match from the checkpoints, then reconsider it
if (Checkpoints::CheckBlock(pindex->nHeight - 1, block.hashPrevBlock, true)) {
if (pindex && Checkpoints::CheckBlock(pindex->nHeight - 1, block.hashPrevBlock, true)) {
LogPrintf("%s : Reconsidering block %s height %d\n", __func__, pindexPrev->GetBlockHash().GetHex(), pindexPrev->nHeight);
CValidationState statePrev;
ReconsiderBlock(statePrev, pindexPrev);
Expand Down

0 comments on commit fdaea40

Please sign in to comment.