added peer_versions to web api
authorForrest Voight <forrest.voight@gmail.com>
Tue, 6 Mar 2012 18:03:38 +0000 (13:03 -0500)
committerForrest Voight <forrest.voight@gmail.com>
Tue, 6 Mar 2012 18:03:38 +0000 (13:03 -0500)
p2pool/web.py

index f4e0bde..ef10b91 100644 (file)
@@ -162,6 +162,7 @@ def get_web_root(tracker, current_work, current_work2, get_current_txouts, datad
     web_root.putChild('global_stats', WebInterface(get_global_stats, 'application/json'))
     web_root.putChild('local_stats', WebInterface(get_local_stats, 'application/json'))
     web_root.putChild('peer_addresses', WebInterface(get_peer_addresses, 'text/plain'))
+    web_root.putChild('peer_versions', WebInterface(lambda: ''.join(peer.other_sub_version+'\n' for peer in p2p_node.peers.itervalues()), 'text/plain'))
     web_root.putChild('payout_addr', WebInterface(lambda: json.dumps(bitcoin_data.pubkey_hash_to_address(my_pubkey_hash, net.PARENT)), 'application/json'))
     web_root.putChild('recent_blocks', WebInterface(lambda: json.dumps(recent_blocks), 'application/json'))
     web_root.putChild('uptime', WebInterface(get_uptime, 'application/json'))