work on sockets

master
Kevin Froman 2018-09-24 17:04:17 -05:00
parent fa701f37dc
commit 8b4105fac4
1 changed files with 3 additions and 1 deletions

View File

@ -120,6 +120,7 @@ class OnionrSocketClient:
def startSocket(self, peer, reason):
address = ''
logger.info('Trying to find socket server for %s' % (peer,))
# Find the newest open socket for a given peer
for block in self._core.getBlocksByType('socket'):
block = onionrblockapi.Block(block, core=self._myCore)
@ -128,6 +129,7 @@ class OnionrSocketClient:
address = block.getMetadata('address')
if self._core._utils.validateID(address):
# If we got their address, it is valid, and verified, we can break out
if block.getMetadata('reason') == 'chat':
break
else:
address = ''