https://cirrus-ci.com/task/5603470202896384?logs=ci#L2681
}
    int chain_depth = GetTxDepthInMainChain(wtx);
    assert(chain_depth >= 0); // coinbase tx should not be conflicted
    return stdmax(0, (COINBASE_MATURITY+1) - chain_depth);
}
bool CWalletIsTxImmatureCoinBase(const CWalletTx& wtx) const
{
    AssertLockHeld(cs_);
    // note GetBlocksToMaturity is 0 for non-coinbase tx
    return GetTxBlocksToMaturity(wtx) > 0;
}
bool CWalletIsCrypted() const
{
    return HasEncryptionKeys();
}
bool CWalletIsLocked() const
{
    if (!IsCrypted()) {
        return false;
    }
    LOCK(cs_);
    return vMasterKey.empty();
}
bool CWalletLock()
{
    if (!IsCrypted())
        return false;
    {
        LOCK(cs_);
        vMasterKey.clear();