https://travis-ci.org/github/bitcoin/bitcoin/jobs/679885530#L8791
{
        const uint256& wtxid = entry.first;
        const CWalletTx& wtx = entry.second;
        if (!chain().checkFinalTx(*wtx.tx)) {
            continue;
        }
        if (wtx.IsImmatureCoinBase())
            continue;
        int nDepth = wtx.GetDepthInMainChain();
        if (nDepth < 0)
            continue;
        
        
        if (nDepth == 0 && !wtx.InMempool())
            continue;
        bool safeTx = IsTrusted(wtx, trusted_parents);