From 71bd0dc70e69d3c64635fc99d51726de845a7d83 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 16 Jul 2018 11:14:06 +0200 Subject: [PATCH] fix crash in lnworker main_loop --- electrum/lnworker.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/electrum/lnworker.py b/electrum/lnworker.py index 1f9438214..1f131857a 100644 --- a/electrum/lnworker.py +++ b/electrum/lnworker.py @@ -53,7 +53,6 @@ class LNWorker(PrintError): def suggest_peer(self): for node_id, peer in self.peers.items(): - print(bh2u(node_id), len(peer.channels)) if len(peer.channels) > 0: continue if not(peer.initialized.done()): @@ -206,6 +205,8 @@ class LNWorker(PrintError): self.peers.pop(k) if len(self.peers) > 3: continue + if not self.network.lightning_nodes: + continue node_id = random.choice(list(self.network.lightning_nodes.keys())) node = self.network.lightning_nodes.get(node_id) addresses = node.get('addresses')