mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-25 22:57:46 +00:00
wallet2: make fake out selection messages less spammy
This commit is contained in:
parent
e19652df51
commit
92a0827eea
1 changed files with 18 additions and 3 deletions
|
@ -37,6 +37,8 @@
|
||||||
#include <boost/algorithm/string/classification.hpp>
|
#include <boost/algorithm/string/classification.hpp>
|
||||||
#include <boost/algorithm/string/trim.hpp>
|
#include <boost/algorithm/string/trim.hpp>
|
||||||
#include <boost/algorithm/string/split.hpp>
|
#include <boost/algorithm/string/split.hpp>
|
||||||
|
#include <boost/algorithm/string/join.hpp>
|
||||||
|
#include <boost/range/adaptor/transformed.hpp>
|
||||||
#include "include_base_utils.h"
|
#include "include_base_utils.h"
|
||||||
using namespace epee;
|
using namespace epee;
|
||||||
|
|
||||||
|
@ -6968,6 +6970,8 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
|
||||||
LOG_PRINT_L1("Selecting real output: " << td.m_global_output_index << " for " << print_money(amount));
|
LOG_PRINT_L1("Selecting real output: " << td.m_global_output_index << " for " << print_money(amount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unordered_map<const char*, std::set<uint64_t>> picks;
|
||||||
|
|
||||||
// while we still need more mixins
|
// while we still need more mixins
|
||||||
uint64_t num_usable_outs = num_outs;
|
uint64_t num_usable_outs = num_outs;
|
||||||
bool allow_blackballed = false;
|
bool allow_blackballed = false;
|
||||||
|
@ -7066,11 +7070,15 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
|
||||||
}
|
}
|
||||||
seen_indices.emplace(i);
|
seen_indices.emplace(i);
|
||||||
|
|
||||||
LOG_PRINT_L2("picking " << i << " as " << type);
|
picks[type].insert(i);
|
||||||
req.outputs.push_back({amount, i});
|
req.outputs.push_back({amount, i});
|
||||||
++num_found;
|
++num_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const auto &pick: picks)
|
||||||
|
MDEBUG("picking " << pick.first << " outputs: " <<
|
||||||
|
boost::join(pick.second | boost::adaptors::transformed([](uint64_t out){return std::to_string(out);}), " "));
|
||||||
|
|
||||||
// if we had enough unusable outputs, we might fall off here and still
|
// if we had enough unusable outputs, we might fall off here and still
|
||||||
// have too few outputs, so we stuff with one to keep counts good, and
|
// have too few outputs, so we stuff with one to keep counts good, and
|
||||||
// we'll error out later
|
// we'll error out later
|
||||||
|
@ -7086,8 +7094,15 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
|
||||||
[](const get_outputs_out &a, const get_outputs_out &b) { return a.index < b.index; });
|
[](const get_outputs_out &a, const get_outputs_out &b) { return a.index < b.index; });
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto i: req.outputs)
|
if (ELPP->vRegistry()->allowed(el::Level::Debug, MONERO_DEFAULT_LOG_CATEGORY))
|
||||||
LOG_PRINT_L1("asking for output " << i.index << " for " << print_money(i.amount));
|
{
|
||||||
|
std::map<uint64_t, std::set<uint64_t>> outs;
|
||||||
|
for (const auto &i: req.outputs)
|
||||||
|
outs[i.amount].insert(i.index);
|
||||||
|
for (const auto &o: outs)
|
||||||
|
MDEBUG("asking for outputs with amount " << print_money(o.first) << ": " <<
|
||||||
|
boost::join(o.second | boost::adaptors::transformed([](uint64_t out){return std::to_string(out);}), " "));
|
||||||
|
}
|
||||||
|
|
||||||
// get the keys for those
|
// get the keys for those
|
||||||
m_daemon_rpc_mutex.lock();
|
m_daemon_rpc_mutex.lock();
|
||||||
|
|
Loading…
Reference in a new issue