Guard against prev block on csv in regtest

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
This commit is contained in:
Anthony Fieroni 2020-02-13 17:39:48 +02:00
parent b4bc48552c
commit 55721a75f8

View file

@ -3679,7 +3679,7 @@ static bool ContextualCheckBlock(const CBlock& block, CValidationState& state, c
// Start enforcing BIP113 (Median Time Past). // Start enforcing BIP113 (Median Time Past).
int nLockTimeFlags = 0; int nLockTimeFlags = 0;
if (nHeight >= consensusParams.CSVHeight) { if (nHeight >= consensusParams.CSVHeight) {
assert(pindexPrev != nullptr); if (pindexPrev != nullptr)
nLockTimeFlags |= LOCKTIME_MEDIAN_TIME_PAST; nLockTimeFlags |= LOCKTIME_MEDIAN_TIME_PAST;
} }