Browse Source

add method get_node_alias to lnworker

patch-4
ThomasV 4 years ago
parent
commit
89a14996ce
  1. 6
      electrum/gui/qt/channels_list.py
  2. 8
      electrum/lnworker.py

6
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,

8
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')

Loading…
Cancel
Save