Added simple API for boolean of fully connected status (i.e. green light)
This commit is contained in:
parent
db31cb4147
commit
8be018e9ac
|
@ -740,6 +740,8 @@ class MySimpleXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
|
||||||
return data
|
return data
|
||||||
elif method == 'clientStatus':
|
elif method == 'clientStatus':
|
||||||
return '{ "networkConnections" : "%s" }' % str(len(shared.connectedHostsList))
|
return '{ "networkConnections" : "%s" }' % str(len(shared.connectedHostsList))
|
||||||
|
elif method == 'fullyConnected':
|
||||||
|
return '"%s"' % shared.definitelyFullyConnected
|
||||||
else:
|
else:
|
||||||
return 'API Error 0020: Invalid method: %s' % method
|
return 'API Error 0020: Invalid method: %s' % method
|
||||||
|
|
||||||
|
|
|
@ -256,6 +256,7 @@ class receiveDataThread(threading.Thread):
|
||||||
def connectionFullyEstablished(self):
|
def connectionFullyEstablished(self):
|
||||||
self.connectionIsOrWasFullyEstablished = True
|
self.connectionIsOrWasFullyEstablished = True
|
||||||
if not self.initiatedConnection:
|
if not self.initiatedConnection:
|
||||||
|
shared.definitelyFullyConnected = True
|
||||||
shared.UISignalQueue.put(('setStatusIcon', 'green'))
|
shared.UISignalQueue.put(('setStatusIcon', 'green'))
|
||||||
self.sock.settimeout(
|
self.sock.settimeout(
|
||||||
600) # We'll send out a pong every 5 minutes to make sure the connection stays alive if there has been no other traffic to send lately.
|
600) # We'll send out a pong every 5 minutes to make sure the connection stays alive if there has been no other traffic to send lately.
|
||||||
|
|
|
@ -47,6 +47,7 @@ inventory = {} #of objects (like msg payloads and pubkey payloads) Does not incl
|
||||||
inventoryLock = threading.Lock() #Guarantees that two receiveDataThreads don't receive and process the same message concurrently (probably sent by a malicious individual)
|
inventoryLock = threading.Lock() #Guarantees that two receiveDataThreads don't receive and process the same message concurrently (probably sent by a malicious individual)
|
||||||
printLock = threading.Lock()
|
printLock = threading.Lock()
|
||||||
appdata = '' #holds the location of the application data storage directory
|
appdata = '' #holds the location of the application data storage directory
|
||||||
|
definitelyFullyConnected = False
|
||||||
statusIconColor = 'red'
|
statusIconColor = 'red'
|
||||||
connectedHostsList = {} #List of hosts to which we are connected. Used to guarantee that the outgoingSynSender threads won't connect to the same remote node twice.
|
connectedHostsList = {} #List of hosts to which we are connected. Used to guarantee that the outgoingSynSender threads won't connect to the same remote node twice.
|
||||||
shutdown = 0 #Set to 1 by the doCleanShutdown function. Used to tell the proof of work worker threads to exit.
|
shutdown = 0 #Set to 1 by the doCleanShutdown function. Used to tell the proof of work worker threads to exit.
|
||||||
|
|
Reference in New Issue
Block a user