mirror of
https://github.com/wownero/wownero.git
synced 2026-10-17 07:31:35 +02:00
wallet2: sanitize untrusted daemon status in sweep unmixable
(cherry picked from commit 144b3f9e644c0b1d4ad994b99edf6c355b38e533)
This commit is contained in:
@@ -12479,7 +12479,7 @@ std::vector<size_t> wallet2::select_available_outputs_from_histogram(uint64_t co
|
|||||||
uint64_t pre_call_credits = m_rpc_payment_state.credits;
|
uint64_t pre_call_credits = m_rpc_payment_state.credits;
|
||||||
req_t.client = get_client_signature();
|
req_t.client = get_client_signature();
|
||||||
bool r = net_utils::invoke_http_json_rpc("/json_rpc", "get_output_histogram", req_t, resp_t, *m_http_client, rpc_timeout);
|
bool r = net_utils::invoke_http_json_rpc("/json_rpc", "get_output_histogram", req_t, resp_t, *m_http_client, rpc_timeout);
|
||||||
THROW_ON_RPC_RESPONSE_ERROR(r, {}, resp_t, "get_output_histogram", error::get_histogram_error, resp_t.status);
|
THROW_ON_RPC_RESPONSE_ERROR(r, {}, resp_t, "get_output_histogram", error::get_histogram_error, get_rpc_status(resp_t.status));
|
||||||
uint64_t cost = req_t.amounts.empty() ? COST_PER_FULL_OUTPUT_HISTOGRAM : (COST_PER_OUTPUT_HISTOGRAM * req_t.amounts.size());
|
uint64_t cost = req_t.amounts.empty() ? COST_PER_FULL_OUTPUT_HISTOGRAM : (COST_PER_OUTPUT_HISTOGRAM * req_t.amounts.size());
|
||||||
check_rpc_cost("get_output_histogram", resp_t.credits, pre_call_credits, cost);
|
check_rpc_cost("get_output_histogram", resp_t.credits, pre_call_credits, cost);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user