diff --git a/src/currency_core/currency_format_utils_transactions.h b/src/currency_core/currency_format_utils_transactions.h index 93cb23a3..af78a741 100644 --- a/src/currency_core/currency_format_utils_transactions.h +++ b/src/currency_core/currency_format_utils_transactions.h @@ -18,12 +18,14 @@ namespace currency { struct output_entry { - //output_entry(const txout_ref_v& out_reference, const crypto::public_key& stealth_address) - // : out_reference(out_reference), stealth_address(stealth_address), concealing_point(null_pkey), amount_commitment(null_pkey) {} + output_entry() = default; + output_entry(const output_entry &) = default; + output_entry(const txout_ref_v& out_reference, const crypto::public_key& stealth_address) + : out_reference(out_reference), stealth_address(stealth_address), concealing_point(null_pkey), amount_commitment(null_pkey) {} //output_entry(const txout_ref_v& out_reference, const crypto::public_key& stealth_address, const crypto::public_key& concealing_point, const crypto::public_key& amount_commitment) // : out_reference(out_reference), stealth_address(stealth_address), concealing_point(concealing_point), amount_commitment(amount_commitment) {} - txout_ref_v out_reference; // either globbal output index or ref_by_id + txout_ref_v out_reference; // either global output index or ref_by_id crypto::public_key stealth_address; // a.k.a output's one-time public key crypto::public_key concealing_point; // only for zarcaum outputs crypto::public_key amount_commitment; // only for zarcaum outputs diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index f6bdb3f5..be97ec72 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -5859,7 +5859,7 @@ void wallet2::sweep_below(size_t fake_outs_count, const currency::account_public { if (td.m_global_output_index == daemon_oe.global_amount_index) continue; - tx_output_entry oe; + tx_output_entry oe = AUTO_VAL_INIT(oe); oe.out_reference = daemon_oe.global_amount_index; oe.stealth_address = daemon_oe.out_key; src.outputs.push_back(oe); diff --git a/tests/core_tests/alias_tests.cpp b/tests/core_tests/alias_tests.cpp index 108ed432..4b8e98ad 100644 --- a/tests/core_tests/alias_tests.cpp +++ b/tests/core_tests/alias_tests.cpp @@ -885,7 +885,11 @@ bool gen_alias_reg_with_locked_money::generate(std::vector& ev currency::tx_source_entry se = AUTO_VAL_INIT(se); se.amount = boost::get(blk_0.miner_tx.vout[0]).amount; - se.outputs.push_back(make_serializable_pair(0, boost::get(boost::get(blk_0.miner_tx.vout[0]).target).key)); + currency::tx_source_entry::output_entry oe = AUTO_VAL_INIT(oe); + oe.out_reference = 0; + oe.stealth_address = boost::get(boost::get(blk_0.miner_tx.vout[0]).target).key; + se.outputs.push_back(oe); + //se.outputs.push_back(make_serializable_pair(0, boost::get(boost::get(blk_0.miner_tx.vout[0]).target).key)); se.real_output = 0; se.real_output_in_tx_index = 0; se.real_out_tx_key = currency::get_tx_pub_key_from_extra(blk_0.miner_tx); @@ -1160,7 +1164,7 @@ bool gen_alias_tx_no_outs::generate(std::vector& events) const currency::tx_source_entry se = AUTO_VAL_INIT(se); se.amount = boost::get(blk_0.miner_tx.vout[0]).amount; - se.outputs.push_back(make_serializable_pair(0, boost::get(boost::get(blk_0.miner_tx.vout[0]).target).key)); + se.outputs.push_back(currency::tx_source_entry::output_entry(0, boost::get(boost::get(blk_0.miner_tx.vout[0]).target).key)); se.real_output = 0; se.real_output_in_tx_index = 0; se.real_out_tx_key = currency::get_tx_pub_key_from_extra(blk_0.miner_tx); diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp index f42d5e6a..704045a5 100644 --- a/tests/core_tests/chaingen.cpp +++ b/tests/core_tests/chaingen.cpp @@ -1240,7 +1240,7 @@ bool fill_tx_sources(std::vector& sources, const std: { for (const auto& s_outputs_el : s.outputs) // avoid all outputs, including fake mix-ins { - txout_ref_v sout = s_outputs_el.first; + txout_ref_v sout = s_outputs_el.out_reference; if (sout.type().hash_code() == typeid(uint64_t).hash_code()) // output by global index { uint64_t gindex = boost::get(sout); diff --git a/tests/core_tests/double_spend.inl b/tests/core_tests/double_spend.inl index 0c807bb3..0b56af1f 100644 --- a/tests/core_tests/double_spend.inl +++ b/tests/core_tests/double_spend.inl @@ -80,7 +80,7 @@ bool gen_double_spend_in_tx::generate(std::vector(global_out_index, boost::get(boost::get(tx_0.vout[se.real_output_in_tx_index]).target).key)); + se.outputs.push_back(currency::tx_source_entry::output_entry(global_out_index, boost::get(boost::get(tx_0.vout[se.real_output_in_tx_index]).target).key)); se.real_output = 0; se.real_out_tx_key = get_tx_pub_key_from_extra(tx_0); sources.push_back(se); diff --git a/tests/core_tests/integer_overflow.cpp b/tests/core_tests/integer_overflow.cpp index 9e1ad68f..e73c6cef 100644 --- a/tests/core_tests/integer_overflow.cpp +++ b/tests/core_tests/integer_overflow.cpp @@ -40,7 +40,12 @@ namespace { currency::tx_source_entry se = AUTO_VAL_INIT(se); se.amount =boost::get( tx.vout[out_idx]).amount; - se.outputs.push_back(make_serializable_pair(0, boost::get(boost::get(tx.vout[out_idx]).target).key)); + + currency::tx_source_entry::output_entry oe = AUTO_VAL_INIT(oe); + oe.out_reference = 0; + oe.stealth_address = boost::get(boost::get(tx.vout[out_idx]).target).key; + se.outputs.push_back(oe); + //se.outputs.push_back(make_serializable_pair(0, boost::get(boost::get(tx.vout[out_idx]).target).key)); se.real_output = 0; se.real_out_tx_key = get_tx_pub_key_from_extra(tx); se.real_output_in_tx_index = out_idx;