src/wallet/wallet.cpp
CAmount CWallet::GetNormalizedAnonymizedBalance() const
{
    if (fLiteMode) return 0;

    CAmount nTotal = 0;

    {
        LOCK2(cs_main, cs_wallet);
        for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
            const CWalletTx* pcoin = &(*it).second;

            uint256 hash = (*it).first;

            for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
                CTxIn vin = CTxIn(hash, i);

                if (IsSpent(hash, i) || IsMine(pcoin->vout[i]) != ISMINE_SPENDABLE || !IsDenominated(vin)) continue;
                if (pcoin->GetDepthInMainChain() < 0) continue;

                int rounds = GetInputObfuscationRounds(vin);
                nTotal += pcoin->vout[i].nValue * rounds / nSnowgemSendRounds;
            }
        }
    }

    return nTotal;
}
// Note: calculated including unconfirmed,
// that's ok as long as we use it for informational purposes only
calculated including unconfirmed,
that's ok as long as we use it for informational purposes only
calculated including unconfirmed that ' s ok as long as we use it for informational purposes only
CAmount CWallet::GetNormalizedAnonymizedBalance() const
{
    if (fLiteMode) return 0;
    CAmount nTotal = 0;
    {
        LOCK2(cs_main, cs_wallet);
        for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
            const CWalletTx* pcoin = &(*it).second;
            uint256 hash = (*it).first;
            for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
                CTxIn vin = CTxIn(hash, i);
                if (IsSpent(hash, i) || IsMine(pcoin->vout[i]) != ISMINE_SPENDABLE || !IsDenominated(vin)) continue;
                if (pcoin->GetDepthInMainChain() < 0) continue;
                int rounds = GetInputObfuscationRounds(vin);
                nTotal += pcoin->vout[i].nValue * rounds / nSnowgemSendRounds;
            }
        }
    }
    return nTotal;
}
CAmount CWallet :: GetNormalizedAnonymizedBalance ( ) const { if ( fLiteMode ) return 0 ; CAmount nTotal = 0 ; { LOCK2 ( cs_main , cs_wallet ) ; for ( map < uint256 , CWalletTx > :: const_iterator it = mapWallet . begin ( ) ; it != mapWallet . end ( ) ; ++ it ) { const CWalletTx * pcoin = & ( * it ) . second ; uint256 hash = ( * it ) . first ; for ( unsigned int i = 0 ; i < pcoin -> vout . size ( ) ; i ++ ) { CTxIn vin = CTxIn ( hash , i ) ; if ( IsSpent ( hash , i ) || IsMine ( pcoin -> vout [ i ] ) != ISMINE_SPENDABLE || ! IsDenominated ( vin ) ) continue ; if ( pcoin -> GetDepthInMainChain ( ) < 0 ) continue ; int rounds = GetInputObfuscationRounds ( vin ) ; nTotal += pcoin -> vout [ i ] . nValue * rounds / nSnowgemSendRounds ; } } } return nTotal ; }
Note: calculated including unconfirmed,
that's ok as long as we use it for informational purposes only
Note : calculated including unconfirmed that ' s ok as long as we use it for informational purposes only