Skip to content

Commit

Permalink
Merge pull request #1270 from rnicoll/1.10-fixmes
Browse files Browse the repository at this point in the history
Update block height used to determine relevant parameters
  • Loading branch information
langerhans committed Sep 8, 2015
2 parents f5c4d8b + 8f17f8f commit 22c4028
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main.cpp
Expand Up @@ -1186,7 +1186,8 @@ static bool ReadBlockOrHeader(T& block, const CDiskBlockPos& pos)
}

// Check the header
if (!CheckAuxPowProofOfWork(block, Params().GetConsensus(0))) // FIXME: Can we get height at all?
// Dogecoin: We don't necessarily have block height, so we depend on using the base parameters
if (!CheckAuxPowProofOfWork(block, Params().GetConsensus(0)))
return error("ReadBlockFromDisk: Errors in block header at %s", pos.ToString());

return true;
Expand Down Expand Up @@ -2676,7 +2677,10 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne
bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW)
{
// Check proof of work matches claimed amount
if (fCheckPOW && !CheckAuxPowProofOfWork(block, Params().GetConsensus(0))) // FIXME: Get actual height
// We don't have block height as this is called without context (i.e. without
// knowing the previous block), but that's okay, as the checks done are permissive
// (i.e. doesn't check work limit or whether AuxPoW is enabled)
if (fCheckPOW && !CheckAuxPowProofOfWork(block, Params().GetConsensus(0)))
return state.DoS(50, error("CheckBlockHeader(): proof of work failed"),
REJECT_INVALID, "high-hash");

Expand Down

0 comments on commit 22c4028

Please sign in to comment.