parent
ae2cebb2a6
commit
58bc170bda
12
src/api.py
12
src/api.py
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user