From 70b78bb2c8baac5432a2a99f0f2f6122904d1cd7 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 14 Sep 2016 20:20:16 +0100 Subject: wallet: fix misdetection of duplicates --- src/wallet/wallet2.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/wallet') diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index a195abde6..01892dc49 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -2806,9 +2806,10 @@ void wallet2::get_outs(std::vector> &outs, const std::list 0 && daemon_resp.outs[i].key == daemon_resp.outs[i - 1].key) // don't add duplicates + auto item = std::make_tuple(req.outputs[i].index, daemon_resp.outs[i].key, daemon_resp.outs[i].mask); + if (std::find(outs.back().begin(), outs.back().end(), item) != outs.back().end()) // don't add duplicates continue; - outs.back().push_back(std::make_tuple(req.outputs[i].index, daemon_resp.outs[i].key, daemon_resp.outs[i].mask)); + outs.back().push_back(item); } if (outs.back().size() < fake_outputs_count + 1) { @@ -2818,15 +2819,6 @@ void wallet2::get_outs(std::vector> &outs, const std::list(a) < std::get<0>(b); }); - - // sanity check - for (size_t n = 1; n < outs.back().size(); ++n) - { - THROW_WALLET_EXCEPTION_IF(std::get<0>(outs.back()[n]) == std::get<0>(outs.back()[n-1]), error::wallet_internal_error, - "Duplicate indices though we did not ask for any"); - THROW_WALLET_EXCEPTION_IF(std::get<1>(outs.back()[n]) == std::get<1>(outs.back()[n-1]), error::wallet_internal_error, - "Duplicate keys after we have weeded them out"); - } } base += requested_outputs_count; } -- cgit v1.2.3