diff options
| author | Max K. <[email protected]> | 2015-09-09 00:22:44 +0200 |
|---|---|---|
| committer | Max K. <[email protected]> | 2015-09-09 00:22:44 +0200 |
| commit | 22c40283bd3bbcaf24db201a1ecde5e443939197 (patch) | |
| tree | eb3857b2515026616bcbce2f67145cf23fb8f2f8 /src/main.cpp | |
| parent | Merge pull request #1276 from rnicoll/1.10-fees (diff) | |
| parent | Update block height used to determine relevant parameters (diff) | |
| download | discoin-22c40283bd3bbcaf24db201a1ecde5e443939197.tar.xz discoin-22c40283bd3bbcaf24db201a1ecde5e443939197.zip | |
Merge pull request #1270 from rnicoll/1.10-fixmes
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 6c82434c8..cddd30ff7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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; @@ -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"); |