This is to track the regression introduced in master, which needs fixing for 0.14. See #9240, #9371, etc.
if (ShutdownRequested())
            break;
        const CBlockIndex *pindexFork;
        ConnectTrace connectTrace;
        bool fInitialDownload;
        {
            LOCK(cs_main);
            { 
              
              
              
              
              
              
            MemPoolConflictRemovalTracker mrt(mempool);
            CBlockIndex *pindexOldTip = chainActive.Tip();
            if (pindexMostWork == NULL) {
                pindexMostWork = FindMostWorkChain();
            }
            
            if (pindexMostWork == NULL || pindexMostWork == chainActive.Tip())
                return true;
            bool fInvalidFound = false;
            std::shared_ptr<const CBlock> nullBlockPtr;
            if (!ActivateBestChainStep(state, chainparams, pindexMostWork, pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : nullBlockPtr, fInvalidFound, connectTrace))
                return false;
            if (fInvalidFound) {
                
                pindexMostWork = NULL;
            }