From d13368dce4e5c3c5e9d6f0050cc24cee9075aa46 Mon Sep 17 00:00:00 2001 From: sowle Date: Mon, 11 May 2020 21:24:39 +0300 Subject: [PATCH] handling auditable addresses in construct_tx outputs' generation --- src/currency_core/currency_format_utils.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index feae4e80..d4855cd0 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -592,7 +592,12 @@ namespace currency //out to key txout_to_key tk; tk.key = target_keys.back(); - tk.mix_attr = tx_outs_attr; + + if (de.addr.front().is_auditable()) // check only the first address because there's only one in this branch + tk.mix_attr = CURRENCY_TO_KEY_OUT_FORCED_NO_MIX; // override mix_attr to 1 for auditable target addresses + else + tk.mix_attr = tx_outs_attr; + out.target = tk; } else @@ -1109,7 +1114,7 @@ namespace currency //fill outputs size_t output_index = tx.vout.size(); // in case of append mode we need to start output indexing from the last one + 1 std::set deriv_cache; - BOOST_FOREACH(const tx_destination_entry& dst_entr, shuffled_dsts) + for(const tx_destination_entry& dst_entr : shuffled_dsts) { CHECK_AND_ASSERT_MES(dst_entr.amount > 0, false, "Destination with wrong amount: " << dst_entr.amount); bool r = construct_tx_out(dst_entr, txkey.sec, output_index, tx, deriv_cache, tx_outs_attr);