Fix pex result parsing when there is no connection

This commit is contained in:
shortcutme 2019-05-02 17:17:57 +02:00
parent 043ac5a510
commit 6207ccd559
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -274,10 +274,10 @@ class Peer(object):
added = 0 added = 0
# Remove unsupported peer types # Remove unsupported peer types
if "peers_ipv6" in res and "ipv6" not in self.connection.server.supported_ip_types: if "peers_ipv6" in res and self.connection and "ipv6" not in self.connection.server.supported_ip_types:
del res["peers_ipv6"] del res["peers_ipv6"]
if "peers_onion" in res and "onion" not in self.connection.server.supported_ip_types: if "peers_onion" in res and self.connection and "onion" not in self.connection.server.supported_ip_types:
del res["peers_onion"] del res["peers_onion"]
# Add IPv4 + IPv6 # Add IPv4 + IPv6