diff options
author | stoffu <stoffu@protonmail.ch> | 2018-03-22 18:03:57 +0900 |
---|---|---|
committer | stoffu <stoffu@protonmail.ch> | 2018-03-22 20:02:25 +0900 |
commit | eaa8bfe7c0ce7e186cf3ca90a6a44b9a20f4ec03 (patch) | |
tree | 345d979b501f3491bef4797c2959b8b6a80d99b5 /src | |
parent | wallet2: enable the mitigation only after the fork height (diff) | |
download | monero-eaa8bfe7c0ce7e186cf3ca90a6a44b9a20f4ec03.tar.xz |
wallet2: set from_height of GET_OUTPUT_DISTRIBUTION correctly
The previous expression
req_t.from_height = X ? Y >= Z : 0;
forces the parameter to take the value of either 0 or 1.
Diffstat (limited to 'src')
-rw-r--r-- | src/wallet/wallet2.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index ee0a7a2bb..53bfd29b7 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -5815,7 +5815,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>> std::sort(req_t.amounts.begin(), req_t.amounts.end()); auto end = std::unique(req_t.amounts.begin(), req_t.amounts.end()); req_t.amounts.resize(std::distance(req_t.amounts.begin(), end)); - req_t.from_height = segregation_fork_height >= RECENT_OUTPUT_ZONE ? height >= (segregation_fork_height ? segregation_fork_height : height) - RECENT_OUTPUT_BLOCKS : 0; + req_t.from_height = std::max<uint64_t>(segregation_fork_height, RECENT_OUTPUT_BLOCKS) - RECENT_OUTPUT_BLOCKS; req_t.cumulative = true; m_daemon_rpc_mutex.lock(); bool r = net_utils::invoke_http_json_rpc("/json_rpc", "get_output_distribution", req_t, resp_t, m_http_client, rpc_timeout); |