electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 89a14996ced2463379e3d7b252b48a852762cdc9
parent ae15bccb8192532afc4908b43f68797cd6239fd6
Author: ThomasV <thomasv@electrum.org>
Date:   Sat, 19 Dec 2020 15:10:15 +0100

add method get_node_alias to lnworker

Diffstat:
Melectrum/gui/qt/channels_list.py | 6+-----
Melectrum/lnworker.py | 8++++++++
2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/electrum/gui/qt/channels_list.py b/electrum/gui/qt/channels_list.py @@ -79,11 +79,7 @@ class ChannelsList(MyTreeView): labels[subject] = label status = chan.get_state_for_GUI() closed = chan.is_closed() - if self.network and self.network.has_channel_db(): - node_info = self.parent.network.channel_db.get_node_info_for_node_id(chan.node_id) - node_alias = (node_info.alias if node_info else '') or chan.node_id.hex() - else: - node_alias = '' + node_alias = self.lnworker.get_node_alias(chan.node_id) return [ chan.short_id_for_GUI(), node_alias, diff --git a/electrum/lnworker.py b/electrum/lnworker.py @@ -184,6 +184,14 @@ class LNWorker(Logger, NetworkRetryManager[LNPeerAddr]): def channels_for_peer(self, node_id): return {} + def get_node_alias(self, node_id): + if self.channel_db: + node_info = self.channel_db.get_node_info_for_node_id(node_id) + node_alias = (node_info.alias if node_info else '') or node_id.hex() + else: + node_alias = '' + return node_alias + async def maybe_listen(self): # FIXME: only one LNWorker can listen at a time (single port) listen_addr = self.config.get('lightning_listen')