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
1 changed files with 6 additions and 6 deletions

View File

@ -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,