Browse Source

network: fix proxy case

follow-up "healty spread of servers" d8f3ab0917
regtest_lnd
SomberNight 6 years ago
parent
commit
c49d5f672c
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 5
      electrum/interface.py
  2. 2
      electrum/network.py

5
electrum/interface.py

@ -628,7 +628,10 @@ class Interface(PrintError):
def do_bucket(): def do_bucket():
if self.is_tor(): if self.is_tor():
return BUCKET_NAME_OF_ONION_SERVERS return BUCKET_NAME_OF_ONION_SERVERS
ip_addr = ip_address(self.ip_addr()) try:
ip_addr = ip_address(self.ip_addr())
except ValueError:
return ''
if not ip_addr: if not ip_addr:
return '' return ''
if ip_addr.version == 4: if ip_addr.version == 4:

2
electrum/network.py

@ -760,6 +760,8 @@ class Network(PrintError):
# main interface is exempt. this makes switching servers easier # main interface is exempt. this makes switching servers easier
if iface_to_check.is_main_server(): if iface_to_check.is_main_server():
return True return True
if not iface_to_check.bucket_based_on_ipaddress():
return True
# bucket connected interfaces # bucket connected interfaces
with self.interfaces_lock: with self.interfaces_lock:
interfaces = list(self.interfaces.values()) interfaces = list(self.interfaces.values())

Loading…
Cancel
Save