added /peer_txpool_sizes
authorForrest Voight <forrest.voight@gmail.com>
Tue, 16 Oct 2012 02:54:22 +0000 (22:54 -0400)
committerForrest Voight <forrest.voight@gmail.com>
Tue, 16 Oct 2012 02:54:34 +0000 (22:54 -0400)
p2pool/web.py

index ec7b461..a0060c8 100644 (file)
@@ -204,6 +204,7 @@ def get_web_root(tracker, bitcoind_work, get_current_txouts, datadir_path, net,
     web_root.putChild('global_stats', WebInterface(get_global_stats))
     web_root.putChild('local_stats', WebInterface(get_local_stats))
     web_root.putChild('peer_addresses', WebInterface(lambda: ['%s:%i' % (peer.transport.getPeer().host, peer.transport.getPeer().port) for peer in p2p_node.peers.itervalues()]))
+    web_root.putChild('peer_txpool_sizes', WebInterface(lambda: dict(('%s:%i' % (peer.transport.getPeer().host, peer.transport.getPeer().port), peer.remembered_txs_size) for peer in p2p_node.peers.itervalues())))
     web_root.putChild('pings', WebInterface(defer.inlineCallbacks(lambda: defer.returnValue(
         dict([(a, (yield b)) for a, b in
             [(