added kex command
This commit is contained in:
parent
6f761aaeff
commit
80648cc920
@ -248,6 +248,8 @@ class OnionrCommunicatorDaemon:
|
|||||||
continue
|
continue
|
||||||
if self.peerAction(address, 'ping') == 'pong!':
|
if self.peerAction(address, 'ping') == 'pong!':
|
||||||
logger.info('Connected to ' + address)
|
logger.info('Connected to ' + address)
|
||||||
|
time.sleep(0.1)
|
||||||
|
if address not in self.onlinePeers:
|
||||||
self.onlinePeers.append(address)
|
self.onlinePeers.append(address)
|
||||||
retData = address
|
retData = address
|
||||||
break
|
break
|
||||||
@ -307,7 +309,9 @@ class OnionrCommunicatorDaemon:
|
|||||||
elif cmd[0] == 'connectedPeers':
|
elif cmd[0] == 'connectedPeers':
|
||||||
self.printOnlinePeers()
|
self.printOnlinePeers()
|
||||||
elif cmd[0] == 'kex':
|
elif cmd[0] == 'kex':
|
||||||
self.timers['lookupKeys'].count = (self.timers['lookupKeys'].frequency - 1)
|
for i in self.timers:
|
||||||
|
if i.timerFunction.__name__ == 'lookupKeys':
|
||||||
|
i.count = (i.frequency - 1)
|
||||||
else:
|
else:
|
||||||
logger.info('Recieved daemonQueue command:' + cmd[0])
|
logger.info('Recieved daemonQueue command:' + cmd[0])
|
||||||
self.decrementThreadCount('daemonCommands')
|
self.decrementThreadCount('daemonCommands')
|
||||||
|
@ -207,6 +207,7 @@ class Onionr:
|
|||||||
|
|
||||||
'introduce': self.onionrCore.introduceNode,
|
'introduce': self.onionrCore.introduceNode,
|
||||||
'connect': self.addAddress,
|
'connect': self.addAddress,
|
||||||
|
'kex': self.doKEX,
|
||||||
|
|
||||||
'getpassword': self.getWebPassword
|
'getpassword': self.getWebPassword
|
||||||
}
|
}
|
||||||
@ -231,6 +232,7 @@ class Onionr:
|
|||||||
'add-file': 'Create an Onionr block from a file',
|
'add-file': 'Create an Onionr block from a file',
|
||||||
'import-blocks': 'import blocks from the disk (Onionr is transport-agnostic!)',
|
'import-blocks': 'import blocks from the disk (Onionr is transport-agnostic!)',
|
||||||
'listconn': 'list connected peers',
|
'listconn': 'list connected peers',
|
||||||
|
'kex': 'exchange keys with peers (done automatically)',
|
||||||
'introduce': 'Introduce your node to the public Onionr network',
|
'introduce': 'Introduce your node to the public Onionr network',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,6 +336,11 @@ class Onionr:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def doKEX(self):
|
||||||
|
'''make communicator do kex'''
|
||||||
|
logger.info('Sending kex to command queue...')
|
||||||
|
self.onionrCore.daemonQueueAdd('kex')
|
||||||
|
|
||||||
def sendEncrypt(self):
|
def sendEncrypt(self):
|
||||||
'''
|
'''
|
||||||
Create a private message and send it
|
Create a private message and send it
|
||||||
|
Loading…
Reference in New Issue
Block a user