From a6dbc5320971dc12b93f49c77592346e3dd679ae Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 25 May 2022 21:44:49 +0200 Subject: [PATCH] Improved status display for I2P interfaces --- RNS/Interfaces/I2PInterface.py | 3 ++- RNS/Utilities/rnstatus.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RNS/Interfaces/I2PInterface.py b/RNS/Interfaces/I2PInterface.py index ceb2637..f704ff3 100644 --- a/RNS/Interfaces/I2PInterface.py +++ b/RNS/Interfaces/I2PInterface.py @@ -562,7 +562,8 @@ class I2PInterfacePeer(Interface): self.IN = False if hasattr(self, "parent_interface") and self.parent_interface != None: - self.parent_interface.clients -= 1 + if self.parent_interface.clients > 0: + self.parent_interface.clients -= 1 if self in RNS.Transport.interfaces: if not self.initiator: diff --git a/RNS/Utilities/rnstatus.py b/RNS/Utilities/rnstatus.py index e50243a..af59298 100644 --- a/RNS/Utilities/rnstatus.py +++ b/RNS/Utilities/rnstatus.py @@ -100,7 +100,7 @@ def program_setup(configdir, dispall=False, verbosity = 0): clients_string = "Serving : "+str(cnum)+spec_str elif name.startswith("I2PInterface["): if "i2p_connectable" in ifstat and ifstat["i2p_connectable"] == True: - cnum = max(clients-1,0) + cnum = clients if cnum == 1: spec_str = " connected I2P endpoint" else: