diff options
| author | J Ross Nicoll <[email protected]> | 2015-08-27 22:25:34 +0100 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2015-09-08 20:51:24 +0000 |
| commit | 8f17f8f7320d12113836656b0e3c4795ece1fba2 (patch) | |
| tree | 79e19cbfb26c13ac741f92acde83781fa34a631e /src/main.cpp | |
| parent | Merge pull request #1268 from patricklodder/1.10-auxpow-tests (diff) | |
| download | discoin-8f17f8f7320d12113836656b0e3c4795ece1fba2.tar.xz discoin-8f17f8f7320d12113836656b0e3c4795ece1fba2.zip | |
Update block height used to determine relevant parameters
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 070b27832..5fa42d032 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1187,7 +1187,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; @@ -2677,7 +2678,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"); |