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.
This commit is contained in:
stoffu 2018-03-22 18:03:57 +09:00 committed by wowario
parent 3f5e731d31
commit ccae806c13
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111
1 changed files with 1 additions and 1 deletions

View File

@ -5826,7 +5826,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);