validation: assert that pindexPrev is non-null when required

This commit is contained in:
Karl-Johan Alm 2018-11-29 13:14:58 +09:00
parent 60b20c869f
commit fbaaf782ce
No known key found for this signature in database
GPG key ID: 57AF762DB3353322

View file

@ -3267,6 +3267,7 @@ static bool ContextualCheckBlock(const CBlock& block, CValidationState& state, c
// Start enforcing BIP113 (Median Time Past) using versionbits logic.
int nLockTimeFlags = 0;
if (VersionBitsState(pindexPrev, consensusParams, Consensus::DEPLOYMENT_CSV, versionbitscache) == ThresholdState::ACTIVE) {
assert(pindexPrev != nullptr);
nLockTimeFlags |= LOCKTIME_MEDIAN_TIME_PAST;
}