diff --git a/electrum/gui/qt/channels_list.py b/electrum/gui/qt/channels_list.py index cafe8e5a9..73ed65f36 100644 --- a/electrum/gui/qt/channels_list.py +++ b/electrum/gui/qt/channels_list.py @@ -233,7 +233,7 @@ class ChannelsList(MyTreeView): if not item: return channel_id = idx.sibling(idx.row(), self.Columns.NODE_ALIAS).data(ROLE_CHANNEL_ID) - chan = self.lnworker.channels.get(channel_id) or self.lnworker.channel_backups[channel_id] + chan = self.lnworker.get_channel_by_id(channel_id) or self.lnworker.channel_backups[channel_id] menu.addAction(_("Details..."), lambda: self.parent.show_channel_details(chan)) menu.addSeparator() cc = self.add_copy_menu(menu, idx) diff --git a/electrum/gui/qt/history_list.py b/electrum/gui/qt/history_list.py index e7ae601df..662d68400 100644 --- a/electrum/gui/qt/history_list.py +++ b/electrum/gui/qt/history_list.py @@ -738,8 +738,8 @@ class HistoryList(MyTreeView, AcceptFileDragDrop): menu.addAction(_("Edit {}").format(label), lambda p=persistent: self.edit(QModelIndex(p))) menu.addAction(_("View Transaction"), lambda: self.show_transaction(tx_item, tx)) channel_id = tx_item.get('channel_id') - if channel_id: - menu.addAction(_("View Channel"), lambda: self.parent.show_channel(bytes.fromhex(channel_id))) + if channel_id and self.wallet.lnworker and (chan := self.wallet.lnworker.get_channel_by_id(bytes.fromhex(channel_id))): + menu.addAction(_("View Channel"), lambda: self.parent.show_channel_details(chan)) if is_unconfirmed and tx: if tx_details.can_bump: menu.addAction(_("Increase fee"), lambda: self.parent.bump_fee_dialog(tx)) diff --git a/electrum/wallet.py b/electrum/wallet.py index cddd34c05..9be25875e 100644 --- a/electrum/wallet.py +++ b/electrum/wallet.py @@ -1117,6 +1117,8 @@ class Abstract_Wallet(ABC, Logger, EventListener): tx_item['type'] = item['type'] ln_value = Decimal(item['amount_msat']) / 1000 # for channel open/close tx tx_item['ln_value'] = Satoshis(ln_value) + if channel_id := item.get('channel_id'): + tx_item['channel_id'] = channel_id else: if item['type'] == 'swap': # swap items do not have all the fields. We can skip skip them