Rev2056, Add local client to sidebar peer numbers
This commit is contained in:
parent
34a6337c01
commit
d346a532ff
2 changed files with 10 additions and 1 deletions
|
@ -70,6 +70,15 @@ class UiWebsocketPlugin(object):
|
|||
connectable = len([peer_id for peer_id in site.peers.keys() if not peer_id.endswith(":0")])
|
||||
onion = len([peer_id for peer_id in site.peers.keys() if ".onion" in peer_id])
|
||||
peers_total = len(site.peers)
|
||||
|
||||
# Add myself
|
||||
if site.settings["serving"]:
|
||||
peers_total += 1
|
||||
if site.connection_server.port_opened:
|
||||
connectable += 1
|
||||
if site.connection_server.tor_manager.start_onions:
|
||||
onion += 1
|
||||
|
||||
if peers_total:
|
||||
percent_connected = float(connected) / peers_total
|
||||
percent_connectable = float(connectable) / peers_total
|
||||
|
|
|
@ -10,7 +10,7 @@ class Config(object):
|
|||
|
||||
def __init__(self, argv):
|
||||
self.version = "0.5.4"
|
||||
self.rev = 2055
|
||||
self.rev = 2056
|
||||
self.argv = argv
|
||||
self.action = None
|
||||
self.config_file = "zeronet.conf"
|
||||
|
|
Loading…
Reference in a new issue