This is to track the regression introduced in master, which needs fixing for 0.14. See #9240, #9371, etc.
{
    
    if (IsCoinBase() && GetBlocksToMaturity() > 0)
        return 0;
    CAmount credit = 0;
    if (filter & ISMINE_SPENDABLE)
    {
        
        if (fCreditCached)
            credit += nCreditCached;
        else
        {
            nCreditCached = pwallet->GetCredit(*this, ISMINE_SPENDABLE);