| 3282 | } |
| 3283 | |
| 3284 | bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, bool fCheckPOW) |
| 3285 | { |
| 3286 | // Check proof of work matches claimed amount |
| 3287 | if (fCheckPOW && !CheckProofOfWork(block.GetHash(), block.nBits, Params().GetConsensus())) |
| 3288 | return state.DoS(50, error("CheckBlockHeader(): proof of work failed"), |
| 3289 | REJECT_INVALID, "high-hash"); |
| 3290 | |
| 3291 | // Check timestamp |
| 3292 | if (block.GetBlockTime() > GetAdjustedTime() + 2 * 60 * 60) |
| 3293 | return state.Invalid(error("CheckBlockHeader(): block timestamp too far in the future"), |
| 3294 | REJECT_INVALID, "time-too-new"); |
| 3295 | |
| 3296 | return true; |
| 3297 | } |
| 3298 | |
| 3299 | bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bool fCheckMerkleRoot) |
| 3300 | { |
no test coverage detected