message: Update contextual block header check
diff: @@ -4082,8 +4082,8 @@ static bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationSta
  // Check proof of work
  const Consensus::Params& consensusParams = params.GetConsensus();
  - if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))
  - return state.DoS(100, false, REJECT_INVALID, "bad-diffbits", false, "incorrect proof of work");
  + if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams,block.IsProofOfStake()))
  + return state.DoS(100, false, REJECT_INVALID, "bad-diffbits", false, "incorrect difficulty value");
  // Check against checkpoints
  if (fCheckpointsEnabled) {
  @@ -4096,11 +4096,11 @@ static bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationSta
  }
  // Check timestamp against prev
  - if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast())
  + if (pindexPrev && block.IsProofOfStake() && block.GetBlockTime() <= pindexPrev->GetMedianTimePast())
  return state.Invalid(false, REJECT_INVALID, "time-too-old", "block's timestamp is too early");
  // Check timestamp
  - if (block.GetBlockTime() > nAdjustedTime + MAX_FUTURE_BLOCK_TIME)
  + if (block.IsProofOfStake() && block.GetBlockTime() > FutureDrift(nAdjustedTime))
  return state.Invalid(false, REJECT_INVALID, "time-too-new", "block timestamp too far in the future");
  // Reject outdated version blocks when 95% (75% on testnet) of the network has upgraded:
  