MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetValueOut

Method GetValueOut

src/primitives/transaction.cpp:98–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96CTransaction::CTransaction(CMutableTransaction&& tx) : vin(std::move(tx.vin)), vout(std::move(tx.vout)), version{tx.version}, nLockTime{tx.nLockTime}, m_has_witness{ComputeHasWitness()}, hash{ComputeHash()}, m_witness_hash{ComputeWitnessHash()} {}
97
98CAmount CTransaction::GetValueOut() const
99{
100 CAmount nValueOut = 0;
101 for (const auto& tx_out : vout) {
102 if (!MoneyRange(tx_out.nValue) || !MoneyRange(nValueOut + tx_out.nValue))
103 throw std::runtime_error(std::string(__func__) + ": value out of range");
104 nValueOut += tx_out.nValue;
105 }
106 assert(MoneyRange(nValueOut));
107 return nValueOut;
108}
109
110unsigned int CTransaction::ComputeTotalSize() const
111{

Callers 9

ConnectBlockMethod · 0.80
CachedTxGetAmountsFunction · 0.80
gettransactionFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_FIXTURE_TEST_CASEFunction · 0.80
transaction.cppFile · 0.80
toHTMLMethod · 0.80
decomposeTransactionMethod · 0.80
CheckTxInputsMethod · 0.80

Calls 1

MoneyRangeFunction · 0.85

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_FIXTURE_TEST_CASEFunction · 0.64