From 58bc170bda510d8bfee97ed2ff85c30ed9e33fcc Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Thu, 1 Nov 2018 16:53:53 +0200 Subject: [PATCH] Fix #1383 - formatting artifact in 7ed459b --- src/api.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/api.py b/src/api.py index 4d1d404d..9d32a5bb 100644 --- a/src/api.py +++ b/src/api.py @@ -1328,15 +1328,15 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): def HandleClientStatus(self, params): # pylint: disable=unused-argument """Handle a request to get the status of the client""" - if network.stats.connectedHostsList(): + connections_num = len(network.stats.connectedHostsList()) + if connections_num == 0: networkStatus = 'notConnected' - elif not network.stats.connectedHostsList() \ - and not shared.clientHasReceivedIncomingConnections: - networkStatus = 'connectedButHaveNotReceivedIncomingConnections' - else: + elif shared.clientHasReceivedIncomingConnections: networkStatus = 'connectedAndReceivingIncomingConnections' + else: + networkStatus = 'connectedButHaveNotReceivedIncomingConnections' return json.dumps({ - 'networkConnections': len(network.stats.connectedHostsList()), + 'networkConnections': connections_num, 'numberOfMessagesProcessed': shared.numberOfMessagesProcessed, 'numberOfBroadcastsProcessed': shared.numberOfBroadcastsProcessed, 'numberOfPubkeysProcessed': shared.numberOfPubkeysProcessed,