aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-17 18:03:59 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-24 10:47:36 +0000
commitc07bbd5c04f8be6ad19c57077ce80c4304ba92ed (patch)
tree0b3f0dbf696a8d2d6fbf809a736095dc055c99d5
parentMerge pull request #5548 (diff)
downloadmonero-c07bbd5c04f8be6ad19c57077ce80c4304ba92ed.tar.xz
daemon: fix "never seen before" time span display for peers
-rw-r--r--src/daemon/rpc_command_executor.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 151baa33f..90a570223 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -54,7 +54,7 @@ namespace {
std::string id_str;
std::string port_str;
- std::string elapsed = epee::misc_utils::get_time_interval_string(now - last_seen);
+ std::string elapsed = peer.last_seen == 0 ? "never" : epee::misc_utils::get_time_interval_string(now - last_seen);
std::string ip_str = epee::string_tools::get_ip_string_from_int32(peer.ip);
std::stringstream peer_id_str;
peer_id_str << std::hex << std::setw(16) << peer.id;