Dandelion fixes

- in route selector, some connections may not have the services
attribute (yet)
- Addresses #1049
This commit is contained in:
Peter Šurda 2017-09-25 09:17:15 +02:00
parent d574b167d8
commit 9923d288e0
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -61,10 +61,13 @@ class BMConnectionPool(object):
for i in connections: for i in connections:
if i == node: if i == node:
continue continue
try:
if i.services | protocol.NODE_DANDELION: if i.services | protocol.NODE_DANDELION:
peers.append(i) peers.append(i)
if len(peers) == 2: if len(peers) == 2:
break break
except AttributeError:
continue
return peers return peers
def connectToStream(self, streamNumber): def connectToStream(self, streamNumber):