mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 01:35:20 +00:00
fix crash in lnworker main_loop
This commit is contained in:
parent
18bc5aa27b
commit
b5f0209a56
1 changed files with 2 additions and 1 deletions
|
@ -53,7 +53,6 @@ class LNWorker(PrintError):
|
||||||
|
|
||||||
def suggest_peer(self):
|
def suggest_peer(self):
|
||||||
for node_id, peer in self.peers.items():
|
for node_id, peer in self.peers.items():
|
||||||
print(bh2u(node_id), len(peer.channels))
|
|
||||||
if len(peer.channels) > 0:
|
if len(peer.channels) > 0:
|
||||||
continue
|
continue
|
||||||
if not(peer.initialized.done()):
|
if not(peer.initialized.done()):
|
||||||
|
@ -206,6 +205,8 @@ class LNWorker(PrintError):
|
||||||
self.peers.pop(k)
|
self.peers.pop(k)
|
||||||
if len(self.peers) > 3:
|
if len(self.peers) > 3:
|
||||||
continue
|
continue
|
||||||
|
if not self.network.lightning_nodes:
|
||||||
|
continue
|
||||||
node_id = random.choice(list(self.network.lightning_nodes.keys()))
|
node_id = random.choice(list(self.network.lightning_nodes.keys()))
|
||||||
node = self.network.lightning_nodes.get(node_id)
|
node = self.network.lightning_nodes.get(node_id)
|
||||||
addresses = node.get('addresses')
|
addresses = node.get('addresses')
|
||||||
|
|
Loading…
Add table
Reference in a new issue