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 untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
1 changed files with 7 additions and 4 deletions

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
if i.services | protocol.NODE_DANDELION: try:
peers.append(i) if i.services | protocol.NODE_DANDELION:
if len(peers) == 2: peers.append(i)
break if len(peers) == 2:
break
except AttributeError:
continue
return peers return peers
def connectToStream(self, streamNumber): def connectToStream(self, streamNumber):