MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetValueOutMap

Method GetValueOutMap

src/primitives/transaction.cpp:127–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 vin(std::move(tx.vin)), vout(std::move(tx.vout)), nVersion(tx.nVersion), nLockTime(tx.nLockTime), witness(std::move(tx.witness)),hash{ComputeHash()}, m_witness_hash{ComputeWitnessHash()} {}
126
127CAmountMap CTransaction::GetValueOutMap() const {
128
129 CAmountMap values;
130 for (const auto& tx_out : vout) {
131 if (tx_out.nValue.IsExplicit() && tx_out.nAsset.IsExplicit()) {
132 CAmountMap m;
133 m[tx_out.nAsset.GetAsset()] = tx_out.nValue.GetAmount();
134 if (!MoneyRange(tx_out.nValue.GetAmount()) || !MoneyRange(values[tx_out.nAsset.GetAsset()] + tx_out.nValue.GetAmount()))
135 throw std::runtime_error(std::string(__func__) + ": value out of range");
136 values += m;
137 }
138 }
139 assert(MoneyRange(values));
140 return values;
141}
142
143unsigned int CTransaction::GetTotalSize() const
144{

Callers 4

CheckFeeRateFunction · 0.80
FUZZ_TARGET_INITFunction · 0.80
CheckTxInputsMethod · 0.80

Calls 4

IsExplicitMethod · 0.80
GetAssetMethod · 0.80
GetAmountMethod · 0.80
MoneyRangeFunction · 0.50

Tested by 1

FUZZ_TARGET_INITFunction · 0.64