From 009a215224cdd3244fd0bdef0c06b28a424362da Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Fri, 9 Jun 2017 10:07:51 +0200 Subject: [PATCH] Fix api connected hosts lists --- src/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api.py b/src/api.py index 8c959832..eb2712af 100644 --- a/src/api.py +++ b/src/api.py @@ -31,6 +31,7 @@ import state from pyelliptic.openssl import OpenSSL import queues from struct import pack +import network.stats # Classes from helper_sql import sqlQuery,sqlExecute,SqlBulkExecute,sqlStoredProcedure @@ -959,7 +960,7 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): networkStatus = 'connectedButHaveNotReceivedIncomingConnections' else: networkStatus = 'connectedAndReceivingIncomingConnections' - return json.dumps({'networkConnections':len(shared.connectedHostsList),'numberOfMessagesProcessed':shared.numberOfMessagesProcessed, 'numberOfBroadcastsProcessed':shared.numberOfBroadcastsProcessed, 'numberOfPubkeysProcessed':shared.numberOfPubkeysProcessed, 'networkStatus':networkStatus, 'softwareName':'PyBitmessage','softwareVersion':softwareVersion}, indent=4, separators=(',', ': ')) + return json.dumps({'networkConnections':len(network.stats.connectedHostsList()),'numberOfMessagesProcessed':shared.numberOfMessagesProcessed, 'numberOfBroadcastsProcessed':shared.numberOfBroadcastsProcessed, 'numberOfPubkeysProcessed':shared.numberOfPubkeysProcessed, 'networkStatus':networkStatus, 'softwareName':'PyBitmessage','softwareVersion':softwareVersion}, indent=4, separators=(',', ': ')) def HandleDecodeAddress(self, params): # Return a meaningful decoding of an address.