diff --git a/src/validation.cpp b/src/validation.cpp index 74df13f462..96d12f10e2 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2974,6 +2974,10 @@ bool CChainState::PreciousBlock(BlockValidationState& state, const CChainParams& bool CChainState::InvalidateBlock(BlockValidationState& state, const CChainParams& chainparams, CBlockIndex *pindex) { + // Genesis block can't be invalidated + assert(pindex); + if (pindex->nHeight == 0) return false; + CBlockIndex* to_mark_failed = pindex; bool pindex_was_in_chain = false; int disconnected = 0;