From 4bd013ef10486cf5fd3864fc5d94c1747855a2f8 Mon Sep 17 00:00:00 2001 From: f321x Date: Wed, 10 Dec 2025 10:50:01 +0100 Subject: [PATCH 1/2] lnurlw: accept "null" minWithdrawable in response Accept a `null` value as response for the `minWithdrawable` field in the lnurlw response. Some servers seem to set this to `null` instead of 0 when having no minimum withdrawal amount. --- electrum/lnurl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electrum/lnurl.py b/electrum/lnurl.py index 9bfd0592f..a95bf8bcc 100644 --- a/electrum/lnurl.py +++ b/electrum/lnurl.py @@ -179,7 +179,7 @@ def _parse_lnurl3_response(lnurl_response: dict) -> LNURL3Data: raise UntrustedLNURLError(f"Missing k1 value in LNURL3 response: {lnurl_response=}") default_description = lnurl_response.get('defaultDescription', '') try: - min_withdrawable_sat = int(lnurl_response['minWithdrawable']) // 1000 + min_withdrawable_sat = int(lnurl_response['minWithdrawable'] or 0) // 1000 max_withdrawable_sat = int(lnurl_response['maxWithdrawable']) // 1000 assert max_withdrawable_sat >= min_withdrawable_sat, f"Invalid amounts: max < min amount" assert max_withdrawable_sat > 0, f"Invalid max amount: {max_withdrawable_sat} sat" From e1f1e6f788b6d44cff2d45839728dc3962d216e8 Mon Sep 17 00:00:00 2001 From: f321x Date: Wed, 10 Dec 2025 10:55:16 +0100 Subject: [PATCH 2/2] qt: lnurlw: catch UserCancelled on lnurlw withdrawal Catch the UserCancelled exception if the user cancels the lnurlw coroutine dialog during the withdrawal. --- electrum/gui/qt/send_tab.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/electrum/gui/qt/send_tab.py b/electrum/gui/qt/send_tab.py index 2cbcdec9c..b3bdbd60e 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