This is to track the regression introduced in master, which needs fixing for 0.14. See #9240, #9371, etc.
CCoins coins;
            if (!viewMemPool.GetCoins(txin.prevout.hash, coins)) {
                return error("%s: Missing input", __func__);
            }
            if (coins.nHeight == MEMPOOL_HEIGHT) {
                
                prevheights[txinIndex] = tip->nHeight + 1;
            } else {
                prevheights[txinIndex] = coins.nHeight;
            }
        }
        lockPair = CalculateSequenceLocks(tx, flags, &prevheights, index);
        if (lp) {
            lp->height = lockPair.first;
            lp->time = lockPair.second;
            
            
            
            
            
            
            
            
            
            
            
            
            
            int maxInputHeight = 0;
            BOOST_FOREACH(int height, prevheights) {