qt: trustedcoin: only allow signing with broadcast
What changed, and why it matters
This change tightens the user interface for Electrum's two-factor authentication (2FA) wallets. When a 2FA wallet user previews a new transaction, the buttons that let them sign or broadcast it are now hidden. The commit message says this makes it 'slightly less trivial to cheat with the fees.' In plain terms, it closes a small UI path that could let a user manipulate transaction fees in a way the trustedcoin two-factor service is meant to prevent.
Treat as a minor hardening patch. Users of 2FA wallets should update to a version containing this commit. Reviewers may want to confirm that no other code paths (CLI, JSON-RPC, mobile/Kivy, or plugins) still allow signing without broadcast for 2FA wallets, since this patch only covers the Qt preview dialog.
Security signals we found
Fee-manipulation mitigation
UI workflow hardening for 2FA wallets
Trustedcoin two-factor service boundary enforcement
Commit message explicitly frames change as anti-cheating measure
Evidence from the diff
In electrum/gui/qt/send_tab.py, the preview path now passes show_sign_button=False and show_broadcast_button=False to show_transaction() when the wallet type is ‘2fa’ (trustedcoin). Previously, preview mode always showed both buttons. The change forces 2FA transactions to be signed and broadcast together through the normal send flow rather than allowing them to be split or re-broadcast from the preview dialog.
Changed components
electrum/gui/qt/send_tab.py2FA / trustedcoin wallet send flowQt preview transaction dialogInspect captured patch +7 / −1
diff --git a/electrum/gui/qt/send_tab.py b/electrum/gui/qt/send_tab.py
index b3bdbd6..bff1b45 100644
--- a/electrum/gui/qt/send_tab.py
+++ b/electrum/gui/qt/send_tab.py
@@ -370,7 +370,13 @@ class SendTab(QWidget, MessageBoxMixin, Logger):
tx.swap_payment_hash = swap.payment_hash
if is_preview:
- self.window.show_transaction(tx, external_keypairs=external_keypairs, invoice=invoice)
+ self.window.show_transaction(
+ tx,
+ external_keypairs=external_keypairs,
+ invoice=invoice,
+ show_sign_button=self.wallet.wallet_type != '2fa',
+ show_broadcast_button=self.wallet.wallet_type != '2fa',
+ )
return
self.save_pending_invoice()
def sign_done(success):
Why this scored 35/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.