예제 #1
0
파일: coins.cpp 프로젝트: CRYCOM/dash
CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const
{
    if (tx.IsCoinBase())
        return 0;

    CAmount nResult = 0;
    for (unsigned int i = 0; i < tx.vin.size(); i++)
        nResult += GetOutputFor(tx.vin[i]).nValue;

    return nResult;
}
예제 #2
0
파일: coins.cpp 프로젝트: bankonme/zerocash
int64_t CCoinsViewCache::GetValueIn(const CTransaction& tx)
{
    if (tx.IsCoinBase())
        return 0;

    int64_t nResult = 0;
    for (unsigned int i = 0; i < tx.vin.size(); i++){
        nResult += GetOutputFor(tx.vin[i]).nValue;
        // Pours are an input to a transaction, so we count vPub as the input value
        if(tx.vin[i].IsZCPour()){
            nResult +=tx.vin[i].GetBtcContributionOfZerocoinTransaction();
        }
    }
    return nResult;
}
예제 #3
0
CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx, int valuationHeight) const
{
    if (tx.IsCoinBase())
        return 0;

    CAmount nValueIn = 0;
    for (unsigned int i = 0; i < tx.vin.size(); i++){
        CTxOut outTX=GetOutputFor(tx.vin[i]);
        const COutPoint &prevout = tx.vin[i].prevout;
        const CCoins* coins = AccessCoins(prevout.hash);
        nValueIn += outTX.GetValueWithInterest(coins->nHeight,valuationHeight);
    }

    return nValueIn;
}
예제 #4
0
CAmount CCoinsViewCache::GetValueIn(const CTransaction& tx) const
{
    if (tx.IsCoinBase())
        return 0;

    //todo are there any security precautions to take here?
    if (tx.IsZerocoinSpend())
        return tx.GetZerocoinSpent();

    CAmount nResult = 0;
    for (unsigned int i = 0; i < tx.vin.size(); i++)
        nResult += GetOutputFor(tx.vin[i]).nValue;

    return nResult;
}