mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 17:58:52 +00:00
rpc: fix hard_fork_info RPC
I had never tested it, obviously
This commit is contained in:
parent
6f5c129c92
commit
06c65cb0ef
@ -971,11 +971,13 @@ bool t_rpc_command_executor::hard_fork_info(uint8_t version)
|
|||||||
tools::fail_msg_writer() << fail_message.c_str();
|
tools::fail_msg_writer() << fail_message.c_str();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
version = version > 0 ? version : res.voting;
|
|
||||||
tools::msg_writer() << "version " << (uint32_t)version << " " << (res.enabled ? "enabled" : "not enabled") <<
|
|
||||||
", " << res.votes << "/" << res.window << " votes, threshold " << res.threshold;
|
|
||||||
tools::msg_writer() << "current version " << (uint32_t)res.version << ", voting for version " << (uint32_t)res.voting;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
version = version > 0 ? version : res.voting;
|
||||||
|
tools::msg_writer() << "version " << (uint32_t)version << " " << (res.enabled ? "enabled" : "not enabled") <<
|
||||||
|
", " << res.votes << "/" << res.window << " votes, threshold " << res.threshold;
|
||||||
|
tools::msg_writer() << "current version " << (uint32_t)res.version << ", voting for version " << (uint32_t)res.voting;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -889,6 +889,7 @@ namespace cryptonote
|
|||||||
res.version = blockchain.get_current_hard_fork_version();
|
res.version = blockchain.get_current_hard_fork_version();
|
||||||
res.enabled = blockchain.get_hard_fork_voting_info(version, res.window, res.votes, res.threshold, res.voting);
|
res.enabled = blockchain.get_hard_fork_voting_info(version, res.window, res.votes, res.threshold, res.voting);
|
||||||
res.state = blockchain.get_hard_fork_state();
|
res.state = blockchain.get_hard_fork_state();
|
||||||
|
res.status = CORE_RPC_STATUS_OK;
|
||||||
return true;
|
return true;
|
||||||
#else
|
#else
|
||||||
error_resp.code = CORE_RPC_ERROR_CODE_UNSUPPORTED_RPC;
|
error_resp.code = CORE_RPC_ERROR_CODE_UNSUPPORTED_RPC;
|
||||||
|
@ -104,6 +104,7 @@ namespace cryptonote
|
|||||||
MAP_JON_RPC_WE("getblock", on_get_block, COMMAND_RPC_GET_BLOCK)
|
MAP_JON_RPC_WE("getblock", on_get_block, COMMAND_RPC_GET_BLOCK)
|
||||||
MAP_JON_RPC_WE("get_connections", on_get_connections, COMMAND_RPC_GET_CONNECTIONS)
|
MAP_JON_RPC_WE("get_connections", on_get_connections, COMMAND_RPC_GET_CONNECTIONS)
|
||||||
MAP_JON_RPC_WE("get_info", on_get_info_json, COMMAND_RPC_GET_INFO)
|
MAP_JON_RPC_WE("get_info", on_get_info_json, COMMAND_RPC_GET_INFO)
|
||||||
|
MAP_JON_RPC_WE("hard_fork_info", on_hard_fork_info, COMMAND_RPC_HARD_FORK_INFO)
|
||||||
END_JSON_RPC_MAP()
|
END_JSON_RPC_MAP()
|
||||||
END_URI_MAP2()
|
END_URI_MAP2()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user