|
|
|
@ -207,6 +207,68 @@ rpccalls::get_network_info(COMMAND_RPC_GET_INFO::response& response)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
rpccalls::get_hardfork_info(COMMAND_RPC_HARD_FORK_INFO::response& response)
|
|
|
|
|
{
|
|
|
|
|
epee::json_rpc::request<cryptonote::COMMAND_RPC_HARD_FORK_INFO::request> req_t = AUTO_VAL_INIT(req_t);
|
|
|
|
|
epee::json_rpc::response<cryptonote::COMMAND_RPC_HARD_FORK_INFO::response, std::string> resp_t = AUTO_VAL_INIT(resp_t);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool r {false};
|
|
|
|
|
|
|
|
|
|
req_t.jsonrpc = "2.0";
|
|
|
|
|
req_t.id = epee::serialization::storage_entry(0);
|
|
|
|
|
req_t.method = "hard_fork_info";
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
std::lock_guard<std::mutex> guard(m_daemon_rpc_mutex);
|
|
|
|
|
|
|
|
|
|
if (!connect_to_monero_deamon())
|
|
|
|
|
{
|
|
|
|
|
cerr << "get_hardfork_info: not connected to deamon" << endl;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
r = epee::net_utils::invoke_http_json("/json_rpc",
|
|
|
|
|
req_t, resp_t,
|
|
|
|
|
m_http_client);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string err;
|
|
|
|
|
|
|
|
|
|
if (r)
|
|
|
|
|
{
|
|
|
|
|
if (resp_t.result.status == CORE_RPC_STATUS_BUSY)
|
|
|
|
|
{
|
|
|
|
|
err = "daemon is busy. Please try again later.";
|
|
|
|
|
}
|
|
|
|
|
else if (resp_t.result.status != CORE_RPC_STATUS_OK)
|
|
|
|
|
{
|
|
|
|
|
err = resp_t.result.status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!err.empty())
|
|
|
|
|
{
|
|
|
|
|
cerr << "Error connecting to Monero deamon due to "
|
|
|
|
|
<< err << endl;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cerr << "Error connecting to Monero deamon at "
|
|
|
|
|
<< deamon_url << endl;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
response = resp_t.result;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
|
rpccalls::get_dynamic_per_kb_fee_estimate(
|
|
|
|
|
uint64_t grace_blocks,
|
|
|
|
|