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; }
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; }
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; }
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; }