qt: disable ln configs in ConfirmTxDialog if no ln
What changed, and why it matters
This commit is a user-interface improvement, not a security fix. It simply grays out two Lightning-related options in the transaction confirmation dialog when the wallet does not support Lightning, and shows a tooltip explaining why. There is no vulnerability being patched.
No security action needed. Treat as a normal UX/usability improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change modifies electrum/gui/qt/confirm_tx_dialog.py so that WALLET_SEND_CHANGE_TO_LIGHTNING and WALLET_ENABLE_SUBMARINE_PAYMENTS menu items are disabled and unchecked when wallet.can_have_lightning() returns False, with a tooltip stating Lightning is unavailable. Previously these options were always enabled, which could confuse users but did not create a security issue.
Changed components
electrum/gui/qt/confirm_tx_dialog.pyInspect captured patch +17 / −2
diff --git a/electrum/gui/qt/confirm_tx_dialog.py b/electrum/gui/qt/confirm_tx_dialog.py
index 5549d7e..b5aeb61 100644
--- a/electrum/gui/qt/confirm_tx_dialog.py
+++ b/electrum/gui/qt/confirm_tx_dialog.py
@@ -500,8 +500,23 @@ class TxEditor(WindowModalDialog, QtEventListener, Logger):
self.resize_to_fit_content()
self.pref_menu.addConfig(self.config.cv.GUI_QT_TX_EDITOR_SHOW_LOCKTIME, callback=cb)
self.pref_menu.addSeparator()
- self.pref_menu.addConfig(self.config.cv.WALLET_SEND_CHANGE_TO_LIGHTNING, callback=self.trigger_update)
- self.pref_menu.addConfig(self.config.cv.WALLET_ENABLE_SUBMARINE_PAYMENTS, callback=self.update_tab_visibility)
+ can_have_lightning = self.wallet.can_have_lightning()
+ send_ch_to_ln = self.pref_menu.addConfig(
+ self.config.cv.WALLET_SEND_CHANGE_TO_LIGHTNING,
+ callback=self.trigger_update,
+ checked=False if not can_have_lightning else None,
+ )
+ sub_payments = self.pref_menu.addConfig(
+ self.config.cv.WALLET_ENABLE_SUBMARINE_PAYMENTS,
+ callback=self.update_tab_visibility,
+ checked=False if not can_have_lightning else None,
+ )
+ if not can_have_lightning: # disable the buttons and override tooltip
+ ln_unavailable_msg = _("Not available for this wallet.") \
+ + "\n" + _("Requires a wallet with Lightning network support.")
+ for ln_conf in (send_ch_to_ln, sub_payments):
+ ln_conf.setEnabled(False)
+ ln_conf.setToolTip(ln_unavailable_msg)
self.pref_menu.addToggle(
_('Use change addresses'),
self.toggle_use_change,
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.