Explicitly assert that chainActive[upgrade.nActivationHeight] is non-null at this point.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2020-05-19 20:13:37 +01:00
parent a76e568800
commit cb7c90522d
1 changed files with 4 additions and 0 deletions

View File

@ -1859,6 +1859,10 @@ bool IsInitialBlockDownload(const CChainParams& chainParams)
_("We are on a chain with sufficient work, but an expected network upgrade has not activated. Your node may be under attack! Shutting down for safety."));
return true;
}
// If an upgrade is active, we must be past its activation height.
assert(chainActive[upgrade.nActivationHeight]);
if (chainActive[upgrade.nActivationHeight]->GetBlockHash() != upgrade.hashActivationBlock.get()) {
AbortNode(
strprintf(