diff --git a/electrum/gui/kivy/uix/dialogs/lightning_channels.py b/electrum/gui/kivy/uix/dialogs/lightning_channels.py index 94af6269d..c138ffbf9 100644 --- a/electrum/gui/kivy/uix/dialogs/lightning_channels.py +++ b/electrum/gui/kivy/uix/dialogs/lightning_channels.py @@ -246,6 +246,7 @@ Builder.load_string(r''' warning: '' is_frozen_for_sending: False is_frozen_for_receiving: False + channel_type:'' BoxLayout: padding: '12dp', '12dp', '12dp', '12dp' spacing: '12dp' @@ -294,6 +295,9 @@ Builder.load_string(r''' BoxLabel: text: _('Frozen (for receiving)') value: str(root.is_frozen_for_receiving) + BoxLabel: + text: _('Channel type') + value: str(root.channel_type) Widget: size_hint: 1, 0.1 TopLabel: @@ -484,6 +488,7 @@ class ChannelDetailsPopup(Popup, Logger): self.warning = '' if self.app.wallet.lnworker.channel_db or self.app.wallet.lnworker.is_trampoline_peer(chan.node_id) else _('Warning') + ': ' + msg self.is_frozen_for_sending = chan.is_frozen_for_sending() self.is_frozen_for_receiving = chan.is_frozen_for_receiving() + self.channel_type = chan.storage['channel_type'].name_minimal self.update_action_dropdown() def update_action_dropdown(self): diff --git a/electrum/gui/qt/channel_details.py b/electrum/gui/qt/channel_details.py index 2d440fae3..1f787ba09 100644 --- a/electrum/gui/qt/channel_details.py +++ b/electrum/gui/qt/channel_details.py @@ -193,6 +193,7 @@ class ChannelDetailsDialog(QtWidgets.QDialog, MessageBoxMixin): form_layout.addRow(_('Remote dust limit:'), self.dust_limit) self.remote_reserve = self.window.format_amount_and_units(chan.config[REMOTE].reserve_sat) form_layout.addRow(_('Remote reserve:'), SelectableLabel(self.remote_reserve)) + form_layout.addRow(_('Channel type:'), SelectableLabel(chan.storage['channel_type'].name_minimal)) vbox.addLayout(form_layout) # add htlc tree view to vbox (wouldn't scale correctly in QFormLayout) diff --git a/electrum/lnutil.py b/electrum/lnutil.py index 02b64f3db..57bf74ccb 100644 --- a/electrum/lnutil.py +++ b/electrum/lnutil.py @@ -1153,6 +1153,10 @@ class ChannelType(IntFlag): byte_length = bit_length // 8 + int(bool(bit_length % 8)) return self.to_bytes(byte_length, byteorder='big') + @property + def name_minimal(self): + return self.name.replace('OPTION_', '') + del LNFC # name is ambiguous without context