After starting from command line bitocoind, it can require minutes to have bitocoind to be real responsive, for example:
`$ ./bitcoin-cli stop`
`error: {"code":-28,"message":"Activating best chain..."}`

In such situation, I had sometimes to "kill -9" bitcoind to stop it.
I would like to be able to stop bitcoind in clean way.

p.s.:
`$ uname -a`
`Darwin isghe.local 14.4.0 Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64 x86_64`

}
/**
 * Calculates the block height and previous block's median time past at
 * which the transaction will be considered final in the context of BIP 68.
 * Also removes from the vector of input heights any entries which did not
 * correspond to sequence locked inputs as they do not affect the calculation.
 */
static std::pair<int, int64_t> CalculateSequenceLocks(const CTransaction &tx, int flags, std::vector<int>* prevHeights, const CBlockIndex& block)
{
    assert(prevHeights->size() == tx.vin.size());
    
    
    
    
    
    int nMinHeight = -1;
    int64_t nMinTime = -1;
    
    
    
    bool fEnforceBIP68 = static_cast<uint32_t>(tx.nVersion) >= 2
                      && flags & LOCKTIME_VERIFY_SEQUENCE;
    
    
    if (!fEnforceBIP68) {
        return std::make_pair(nMinHeight, nMinTime);
    }
    for (size_t txinIndex = 0; txinIndex < tx.vin.size(); txinIndex++) {
        const CTxIn& txin = tx.vin[txinIndex];