Fix #1383 - formatting artifact in 7ed459b

This commit is contained in:
Dmitri Bogomolov 2018-11-01 16:53:53 +02:00
parent ae2cebb2a6
commit 58bc170bda
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -1328,15 +1328,15 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
def HandleClientStatus(self, params): # pylint: disable=unused-argument def HandleClientStatus(self, params): # pylint: disable=unused-argument
"""Handle a request to get the status of the client""" """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' networkStatus = 'notConnected'
elif not network.stats.connectedHostsList() \ elif shared.clientHasReceivedIncomingConnections:
and not shared.clientHasReceivedIncomingConnections:
networkStatus = 'connectedButHaveNotReceivedIncomingConnections'
else:
networkStatus = 'connectedAndReceivingIncomingConnections' networkStatus = 'connectedAndReceivingIncomingConnections'
else:
networkStatus = 'connectedButHaveNotReceivedIncomingConnections'
return json.dumps({ return json.dumps({
'networkConnections': len(network.stats.connectedHostsList()), 'networkConnections': connections_num,
'numberOfMessagesProcessed': shared.numberOfMessagesProcessed, 'numberOfMessagesProcessed': shared.numberOfMessagesProcessed,
'numberOfBroadcastsProcessed': shared.numberOfBroadcastsProcessed, 'numberOfBroadcastsProcessed': shared.numberOfBroadcastsProcessed,
'numberOfPubkeysProcessed': shared.numberOfPubkeysProcessed, 'numberOfPubkeysProcessed': shared.numberOfPubkeysProcessed,