Skip to content

Commit

Permalink
Rev2056, Add local client to sidebar peer numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed May 6, 2017
1 parent 34a6337 commit d346a53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions plugins/Sidebar/SidebarPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ def sidebarRenderPeerStats(self, body, site):
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
Expand Down
2 changes: 1 addition & 1 deletion src/Config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d346a53

Please sign in to comment.