aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/rpc_command_executor.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-10-18 13:18:49 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-10-19 08:39:33 +0000
commita7bffead9e5c0f1943f1459c9d1ab581b4ab11d6 (patch)
treef9f888b05eb71da1bae465c975e0daaa66612890 /src/daemon/rpc_command_executor.cpp
parentMerge pull request #4610 (diff)
downloadmonero-a7bffead9e5c0f1943f1459c9d1ab581b4ab11d6.tar.xz
daemon: fix base fee stating /kB even when it is per byte
Diffstat (limited to 'src/daemon/rpc_command_executor.cpp')
-rw-r--r--src/daemon/rpc_command_executor.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 6464d372f..fb2cc15f8 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -1717,11 +1717,14 @@ bool t_rpc_command_executor::print_blockchain_dynamic_stats(uint64_t nblocks)
cryptonote::COMMAND_RPC_GET_BLOCK_HEADERS_RANGE::response bhres;
cryptonote::COMMAND_RPC_GET_BASE_FEE_ESTIMATE::request fereq;
cryptonote::COMMAND_RPC_GET_BASE_FEE_ESTIMATE::response feres;
+ cryptonote::COMMAND_RPC_HARD_FORK_INFO::request hfreq;
+ cryptonote::COMMAND_RPC_HARD_FORK_INFO::response hfres;
epee::json_rpc::error error_resp;
std::string fail_message = "Problem fetching info";
fereq.grace_blocks = 0;
+ hfreq.version = HF_VERSION_PER_BYTE_FEE;
if (m_is_rpc)
{
if (!m_rpc_client->rpc_request(ireq, ires, "/getinfo", fail_message.c_str()))
@@ -1732,6 +1735,10 @@ bool t_rpc_command_executor::print_blockchain_dynamic_stats(uint64_t nblocks)
{
return true;
}
+ if (!m_rpc_client->json_rpc_request(hfreq, hfres, "hard_fork_info", fail_message.c_str()))
+ {
+ return true;
+ }
}
else
{
@@ -1745,10 +1752,15 @@ bool t_rpc_command_executor::print_blockchain_dynamic_stats(uint64_t nblocks)
tools::fail_msg_writer() << make_error(fail_message, feres.status);
return true;
}
+ if (!m_rpc_server->on_hard_fork_info(hfreq, hfres, error_resp) || hfres.status != CORE_RPC_STATUS_OK)
+ {
+ tools::fail_msg_writer() << make_error(fail_message, hfres.status);
+ return true;
+ }
}
tools::msg_writer() << "Height: " << ires.height << ", diff " << ires.difficulty << ", cum. diff " << ires.cumulative_difficulty
- << ", target " << ires.target << " sec" << ", dyn fee " << cryptonote::print_money(feres.fee) << "/kB";
+ << ", target " << ires.target << " sec" << ", dyn fee " << cryptonote::print_money(feres.fee) << "/" << (hfres.enabled ? "byte" : "kB");
if (nblocks > 0)
{