tnetwork: fix proxy case - electrum - Electrum Bitcoin wallet
 (HTM) git clone https://git.parazyd.org/electrum
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
       ---
 (DIR) commit c49d5f672cfac968a7a510626007e76778aa2c8b
 (DIR) parent 2dca91d048ddf5313f4f6168fca7fcb1e71a6c48
 (HTM) Author: SomberNight <somber.night@protonmail.com>
       Date:   Mon, 15 Apr 2019 10:49:09 +0200
       
       network: fix proxy case
       
       follow-up "healty spread of servers" d8f3ab0917f4300b59442d5d7fc25f1e4d877143
       
       Diffstat:
         M electrum/interface.py               |       5 ++++-
         M electrum/network.py                 |       2 ++
       
       2 files changed, 6 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/electrum/interface.py b/electrum/interface.py
       t@@ -628,7 +628,10 @@ class Interface(PrintError):
                def do_bucket():
                    if self.is_tor():
                        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:
                        return ''
                    if ip_addr.version == 4:
 (DIR) diff --git a/electrum/network.py b/electrum/network.py
       t@@ -760,6 +760,8 @@ class Network(PrintError):
                # main interface is exempt. this makes switching servers easier
                if iface_to_check.is_main_server():
                    return True
       +        if not iface_to_check.bucket_based_on_ipaddress():
       +            return True
                # bucket connected interfaces
                with self.interfaces_lock:
                    interfaces = list(self.interfaces.values())