mirror of
https://github.com/wownero/wownero.git
synced 2026-10-17 07:31:35 +02:00
wallet2: filter unchecked RPC error statuses
(cherry picked from commit c86fd739dceca593346ca3d3d3db835d1308e7ed)
This commit is contained in:
@@ -4403,7 +4403,7 @@ bool wallet2::get_rct_distribution(uint64_t &start_height, std::vector<uint64_t>
|
||||
uint64_t pre_call_credits = m_rpc_payment_state.credits;
|
||||
req.client = get_client_signature();
|
||||
r = net_utils::invoke_http_bin("/get_output_distribution.bin", req, res, *m_http_client, rpc_timeout);
|
||||
THROW_ON_RPC_RESPONSE_ERROR_GENERIC(r, {}, res, "/get_output_distribution.bin");
|
||||
THROW_ON_RPC_RESPONSE_ERROR(r, {}, res, "/get_output_distribution.bin", error::wallet_generic_rpc_error, "/get_output_distribution.bin", get_rpc_status(res.status));
|
||||
check_rpc_cost("/get_output_distribution.bin", res.credits, pre_call_credits, COST_PER_OUTPUT_DISTRIBUTION_0);
|
||||
}
|
||||
catch(...)
|
||||
@@ -12702,7 +12702,7 @@ void wallet2::set_tx_key(const crypto::hash &txid, const crypto::secret_key &tx_
|
||||
pre_call_credits = m_rpc_payment_state.credits;
|
||||
req.client = get_client_signature();
|
||||
r = epee::net_utils::invoke_http_json("/gettransactions", req, res, *m_http_client, rpc_timeout);
|
||||
THROW_ON_RPC_RESPONSE_ERROR_GENERIC(r, {}, res, "/gettransactions");
|
||||
THROW_ON_RPC_RESPONSE_ERROR(r, {}, res, "/gettransactions", error::wallet_generic_rpc_error, "/gettransactions", get_rpc_status(res.status));
|
||||
THROW_WALLET_EXCEPTION_IF(res.txs.size() != 1, error::wallet_internal_error,
|
||||
"daemon returned wrong response for gettransactions, wrong txs count = " +
|
||||
std::to_string(res.txs.size()) + ", expected 1");
|
||||
@@ -12765,7 +12765,7 @@ std::string wallet2::get_spend_proof(const crypto::hash &txid, const std::string
|
||||
pre_call_credits = m_rpc_payment_state.credits;
|
||||
req.client = get_client_signature();
|
||||
r = epee::net_utils::invoke_http_json("/gettransactions", req, res, *m_http_client, rpc_timeout);
|
||||
THROW_ON_RPC_RESPONSE_ERROR_GENERIC(r, {}, res, "gettransactions");
|
||||
THROW_ON_RPC_RESPONSE_ERROR(r, {}, res, "gettransactions", error::wallet_generic_rpc_error, "gettransactions", get_rpc_status(res.status));
|
||||
THROW_WALLET_EXCEPTION_IF(res.txs.size() != 1, error::wallet_internal_error,
|
||||
"daemon returned wrong response for gettransactions, wrong txs count = " +
|
||||
std::to_string(res.txs.size()) + ", expected 1");
|
||||
@@ -12890,7 +12890,7 @@ bool wallet2::check_spend_proof(const crypto::hash &txid, const std::string &mes
|
||||
pre_call_credits = m_rpc_payment_state.credits;
|
||||
req.client = get_client_signature();
|
||||
r = epee::net_utils::invoke_http_json("/gettransactions", req, res, *m_http_client, rpc_timeout);
|
||||
THROW_ON_RPC_RESPONSE_ERROR_GENERIC(r, {}, res, "gettransactions");
|
||||
THROW_ON_RPC_RESPONSE_ERROR(r, {}, res, "gettransactions", error::wallet_generic_rpc_error, "gettransactions", get_rpc_status(res.status));
|
||||
THROW_WALLET_EXCEPTION_IF(res.txs.size() != 1, error::wallet_internal_error,
|
||||
"daemon returned wrong response for gettransactions, wrong txs count = " +
|
||||
std::to_string(res.txs.size()) + ", expected 1");
|
||||
@@ -16393,7 +16393,7 @@ std::vector<cryptonote::public_node> wallet2::get_public_nodes(bool white_only)
|
||||
{
|
||||
const boost::lock_guard<boost::recursive_mutex> lock{m_daemon_rpc_mutex};
|
||||
bool r = epee::net_utils::invoke_http_json("/get_public_nodes", req, res, *m_http_client, rpc_timeout);
|
||||
THROW_ON_RPC_RESPONSE_ERROR_GENERIC(r, {}, res, "/get_public_nodes");
|
||||
THROW_ON_RPC_RESPONSE_ERROR(r, {}, res, "/get_public_nodes", error::wallet_generic_rpc_error, "/get_public_nodes", get_rpc_status(res.status));
|
||||
}
|
||||
|
||||
std::vector<cryptonote::public_node> nodes;
|
||||
|
||||
Reference in New Issue
Block a user