tfix lnworker.choose_preferred_address - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit c430b39b7d32cbf37a7735c2d94d1c04cebc74ed
DIR parent 139f773c2e199f9b5c71f3450811acfa81918d13
HTML Author: SomberNight <somber.night@protonmail.com>
Date: Wed, 3 Oct 2018 19:56:07 +0200
fix lnworker.choose_preferred_address
Diffstat:
M electrum/lnworker.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
DIR diff --git a/electrum/lnworker.py b/electrum/lnworker.py
t@@ -178,12 +178,13 @@ class LNWorker(PrintError):
@staticmethod
def choose_preferred_address(addr_list: List[Tuple[str, int]]) -> Tuple[str, int]:
+ # choose first one that is an IP
for host, port in addr_list:
if is_ip_address(host):
return host, port
+ # otherwise choose one at random
# TODO maybe filter out onion if not on tor?
- self.print_error('Chose random address from ' + str(node_info.addresses))
- return random.choice(node_info.addresses)
+ return random.choice(addr_list)
def open_channel(self, connect_contents, local_amt_sat, push_amt_sat, pw):
node_id, rest = extract_nodeid(connect_contents)