From a77b931d7645b15fbfade54214d61674072dba69 Mon Sep 17 00:00:00 2001 From: dr|z3d Date: Thu, 26 Aug 2021 08:04:35 +0000 Subject: [PATCH] Console: transit tunnel traffic presentational tweaks --- daemon/HTTPServer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/daemon/HTTPServer.cpp b/daemon/HTTPServer.cpp index 621a5673..4862d605 100644 --- a/daemon/HTTPServer.cpp +++ b/daemon/HTTPServer.cpp @@ -626,7 +626,8 @@ namespace http { s << (double) i2p::transport::transports.GetOutBandwidth () / 1024 << " " << tr(/* tr: Kibibit/s */ "K/s"); s << ""; - if (i2p::context.AcceptsTunnels () && i2p::tunnel::tunnels.CountTransitTunnels()) { + if ((i2p::context.AcceptsTunnels() || i2p::tunnel::tunnels.CountTransitTunnels()) && + (i2p::transport::transports.GetTotalReceivedBytes () > 0)) { if (i2p::transport::transports.GetTransitBandwidth () > 1024*1024*1024 || i2p::transport::transports.GetTransitBandwidth () < 1024) s << std::fixed << std::setprecision(2); @@ -654,7 +655,8 @@ namespace http { ShowTraffic (s, i2p::transport::transports.GetTotalSentBytes ()); s << ""; - if (i2p::context.AcceptsTunnels () && i2p::tunnel::tunnels.CountTransitTunnels()) { + if ((i2p::context.AcceptsTunnels() || i2p::tunnel::tunnels.CountTransitTunnels()) && + (i2p::transport::transports.GetTotalReceivedBytes () > 0)) { s << " / "; s << std::fixed << std::setprecision(0); if (i2p::transport::transports.GetTotalTransitTransmittedBytes () > 1024*1024*1024)