qt: lnurlw: catch UserCancelled on lnurlw withdrawal
What changed, and why it matters
This is a minor user-interface fix. When a user starts a Lightning LNURL-withdrawal in the Electrum desktop app and then clicks Cancel, the app now quietly handles that cancellation instead of possibly showing an unhandled error. It does not create a security vulnerability; it improves the user experience by suppressing a harmless exception.
No security action required. Treat as a normal UX/stability fix.
Security signals we found
No security-relevant signal: change is a UI exception-handling improvement
Exception type is user-initiated cancellation, not an error condition
No cryptographic, network, or permission changes
Evidence from the diff
The patch adds an except UserCancelled: pass clause around run_coroutine_dialog() for LNURL-withdrawal flows in electrum/gui/qt/send_tab.py. Previously, only LNURLError was caught. If the user cancelled the coroutine dialog, UserCancelled would propagate and likely surface as an unhandled exception dialog. The change treats user cancellation as a no-op. There is no evidence of a security flaw being introduced or fixed.
Changed components
electrum/gui/qt/send_tab.pyInspect captured patch +2 / −0
diff --git a/electrum/gui/qt/send_tab.py b/electrum/gui/qt/send_tab.py
index 2cbcdec..b3bdbd6 100644
--- a/electrum/gui/qt/send_tab.py
+++ b/electrum/gui/qt/send_tab.py
@@ -1002,3 +1002,5 @@ class SendTab(QWidget, MessageBoxMixin, Logger):
self.window.run_coroutine_dialog(coro, _("Requesting lightning withdrawal..."))
except LNURLError as e:
self.show_error(f"{_('Failed to request withdrawal')}:\n{str(e)}")
+ except UserCancelled:
+ pass
Why this scored 17/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.