qt: main_window.confirm_tx_dialog: rm dead code
What changed, and why it matters
This commit removes unused code from Electrum's Qt graphical interface. The deleted block checked whether the wallet had enough funds before opening a transaction confirmation dialog, but it was already marked by the developers as likely broken ('FIXME this check looks broken?') and appears to be dead code. The change does not introduce new behavior; it only cleans up an unused code path and makes a function argument keyword-only.
No security action required. Treat as routine code cleanup. Reviewers may optionally verify that ConfirmTxDialog still performs its own funding validation, but the commit itself does not create a vulnerability.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In electrum/gui/qt/main_window.py, the confirm_tx_dialog method had a block that tested d.not_enough_funds and called d.can_pay_assuming_zero_fees() before returning d.run(). The commit removes that block, changes allow_preview to a keyword-only argument, and adds a return type annotation. The removed code was not functional security logic; it was a stale, commented-as-broken guard that did not affect the actual transaction flow because ConfirmTxDialog handles funding checks internally.
Changed components
electrum/gui/qt/main_window.pyInspect captured patch +1 / −8
diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
index 31f0b84..086b735 100644
--- a/electrum/gui/qt/main_window.py
+++ b/electrum/gui/qt/main_window.py
@@ -1509,15 +1509,8 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener):
return
self._open_channel(connect_str, funding_sat, push_amt, funding_tx)
- def confirm_tx_dialog(self, make_tx, output_value, allow_preview=True, batching_candidates=None):
+ def confirm_tx_dialog(self, make_tx, output_value, *, allow_preview=True, batching_candidates=None) -> tuple[Optional[PartialTransaction], bool]:
d = ConfirmTxDialog(window=self, make_tx=make_tx, output_value=output_value, allow_preview=allow_preview, batching_candidates=batching_candidates)
- if d.not_enough_funds: # FIXME this check looks broken?
- # note: use confirmed_only=False here, regardless of config setting,
- # as the user needs to get to ConfirmTxDialog to change the config setting
- if not d.can_pay_assuming_zero_fees(confirmed_only=False):
- text = self.wallet.get_text_not_enough_funds_mentioning_frozen(for_amount=output_value)
- self.show_message(text)
- return
return d.run(), d.is_preview
@protected
Why this scored 12/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.