| 96 | CTransaction::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 | |
| 98 | CAmount 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 | |
| 110 | unsigned int CTransaction::ComputeTotalSize() const |
| 111 | { |