| 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 | |
| 127 | CAmountMap 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 | |
| 143 | unsigned int CTransaction::GetTotalSize() const |
| 144 | { |