This is to track the regression introduced in master, which needs fixing for 0.14. See #9240, #9371, etc.
{
    const CBlock& block = *pblock;
    if (fNewBlock) *fNewBlock = false;
    AssertLockHeld(cs_main);
    CBlockIndex *pindexDummy = NULL;
    CBlockIndex *&pindex = ppindex ? *ppindex : pindexDummy;
    if (!AcceptBlockHeader(block, state, chainparams, &pindex))
        return false;
    
    
    
    bool fAlreadyHave = pindex->nStatus & BLOCK_HAVE_DATA;
    bool fHasMoreWork = (chainActive.Tip() ? pindex->nChainWork > chainActive.Tip()->nChainWork : true);
    
    
    
    
    
    bool fTooFarAhead = (pindex->nHeight > int(chainActive.Height() + MIN_BLOCKS_TO_KEEP));
    
    
    
    
    
    
    if (fAlreadyHave) return true;
    if (!fRequested) {