aboutsummaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/rpc_command_executor.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 1c9cd714d..5d8d95b03 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -369,6 +369,7 @@ bool t_rpc_command_executor::show_status() {
cryptonote::COMMAND_RPC_MINING_STATUS::request mreq;
cryptonote::COMMAND_RPC_MINING_STATUS::response mres;
epee::json_rpc::error error_resp;
+ bool has_mining_info = true;
std::string fail_message = "Problem fetching info";
@@ -384,10 +385,8 @@ bool t_rpc_command_executor::show_status() {
{
return true;
}
- if (!m_rpc_client->rpc_request(mreq, mres, "/mining_status", fail_message.c_str()))
- {
- return true;
- }
+ // mining info is only available non unrestricted RPC mode
+ has_mining_info = m_rpc_client->rpc_request(mreq, mres, "/mining_status", fail_message.c_str());
}
else
{
@@ -425,7 +424,7 @@ bool t_rpc_command_executor::show_status() {
% (unsigned long long)(ires.target_height >= ires.height ? ires.target_height : ires.height)
% get_sync_percentage(ires)
% (ires.testnet ? "testnet" : "mainnet")
- % (mining_busy ? "syncing" : mres.active ? ( ( mres.is_background_mining_enabled ? "smart " : "" ) + std::string("mining at ") + get_mining_speed(mres.speed) ) : "not mining")
+ % (!has_mining_info ? "mining info unavailable" : mining_busy ? "syncing" : mres.active ? ( ( mres.is_background_mining_enabled ? "smart " : "" ) + std::string("mining at ") + get_mining_speed(mres.speed) ) : "not mining")
% get_mining_speed(ires.difficulty / ires.target)
% (unsigned)hfres.version
% get_fork_extra_info(hfres.earliest_height, ires.height, ires.target)
@@ -966,7 +965,7 @@ bool t_rpc_command_executor::print_transaction_pool_stats() {
denom = n-1;
for (i=0; i<denom; i++)
times[i] = i * numer / denom;
- times[i] = res.pool_stats.oldest;
+ times[i] = now - res.pool_stats.oldest;
} else
{
numer = now - res.pool_stats.oldest;