From: Forrest Voight Date: Tue, 6 Mar 2012 18:03:38 +0000 (-0500) Subject: added peer_versions to web api X-Git-Tag: 0.10.0~68 X-Git-Url: https://git.novaco.in/?p=p2pool.git;a=commitdiff_plain;h=a12f0673adc9b6f63c3c9d88a821dbb641cc5cba added peer_versions to web api --- diff --git a/p2pool/web.py b/p2pool/web.py index f4e0bde..ef10b91 100644 --- a/p2pool/web.py +++ b/p2pool/web.py @@ -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'))