aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/rpc_command_executor.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-02-02 21:38:15 +0200
committerRiccardo Spagni <ric@spagni.net>2017-02-02 21:38:15 +0200
commitf4fe39ca92de23baca4750455bfa2a6c31592f0f (patch)
tree80e438eb870f3d90d524da55f0cff67a4b6097f0 /src/daemon/rpc_command_executor.cpp
parentMerge pull request #1652 (diff)
parentAdded days uptime to the status message (diff)
downloadmonero-f4fe39ca92de23baca4750455bfa2a6c31592f0f.tar.xz
Merge pull request #1654
084aef70 Added days uptime to the status message (NanoAkron)
Diffstat (limited to 'src/daemon/rpc_command_executor.cpp')
-rw-r--r--src/daemon/rpc_command_executor.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 7bc9afbb9..2bcfd7a95 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -368,7 +368,7 @@ bool t_rpc_command_executor::show_status() {
std::time_t uptime = std::time(nullptr) - ires.start_time;
- tools::success_msg_writer() << boost::format("Height: %llu/%llu (%.1f%%) on %s, %s, net hash %s, v%u%s, %s, %u+%u connections, uptime %uh %um %us")
+ tools::success_msg_writer() << boost::format("Height: %llu/%llu (%.1f%%) on %s, %s, net hash %s, v%u%s, %s, %u+%u connections, uptime %ud %uh %um %us")
% (unsigned long long)ires.height
% (unsigned long long)(ires.target_height >= ires.height ? ires.target_height : ires.height)
% get_sync_percentage(ires)
@@ -378,9 +378,11 @@ bool t_rpc_command_executor::show_status() {
% (unsigned)hfres.version
% get_fork_extra_info(hfres.earliest_height, ires.height, ires.target)
% (hfres.state == cryptonote::HardFork::Ready ? "up to date" : hfres.state == cryptonote::HardFork::UpdateNeeded ? "update needed" : "out of date, likely forked")
- % (unsigned)ires.outgoing_connections_count % (unsigned)ires.incoming_connections_count
- % (unsigned int)floor(uptime / 3600.0)
- % (unsigned int)floor(fmod(uptime, 3600.0) / 60.0)
+ % (unsigned)ires.outgoing_connections_count
+ % (unsigned)ires.incoming_connections_count
+ % (unsigned int)floor(uptime / 60.0 / 60.0 / 24.0)
+ % (unsigned int)floor(fmod((uptime / 60.0 / 60.0), 24.0)
+ % (unsigned int)floor(fmod((uptime / 60.0), 60.0)
% (unsigned int)fmod(uptime, 60.0)
;