diff --git a/src/main.cpp b/src/main.cpp index a3acf0c51e9cf..2c9b5c7edb488 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5176,7 +5176,11 @@ bool ProcessNewBlock(CValidationState& state, CNode* pfrom, CBlock* pblock, CDis bool TestBlockValidity(CValidationState& state, const CBlock& block, CBlockIndex* const pindexPrev, bool fCheckPOW, bool fCheckMerkleRoot) { AssertLockHeld(cs_main); - assert(pindexPrev && pindexPrev == chainActive.Tip()); + assert(pindexPrev); + if (pindexPrev != chainActive.Tip()) { + LogPrintf("TestBlockValidity(): No longer working on chain tip\n"); + return false; + } CCoinsViewCache viewNew(pcoinsTip); CBlockIndex indexDummy(block);