From 724576292237600b5de6982f0d1843c8afbffa09 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Tue, 22 Aug 2023 17:00:17 +0000 Subject: [PATCH] qt: fix lnurl-pay regression from https://github.com/spesmilo/electrum/pull/8462 --- electrum/gui/qt/send_tab.py | 4 ++-- electrum/payment_identifier.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/electrum/gui/qt/send_tab.py b/electrum/gui/qt/send_tab.py index 8de66f2e3..8bfe88e1d 100644 --- a/electrum/gui/qt/send_tab.py +++ b/electrum/gui/qt/send_tab.py @@ -511,13 +511,13 @@ class SendTab(QWidget, MessageBoxMixin, Logger): # must not be None return self.amount_e.get_amount() or 0 - def on_finalize_done(self, pi): + def on_finalize_done(self, pi: PaymentIdentifier): self.showSpinner(False) self.update_fields() if pi.error: self.show_error(pi.error) return - invoice = pi.get_invoice(self.get_amount(), self.get_message()) + invoice = pi.bolt11 self.pending_invoice = invoice self.logger.debug(f'after finalize invoice: {invoice!r}') self.do_pay_invoice(invoice) diff --git a/electrum/payment_identifier.py b/electrum/payment_identifier.py index 556f2da69..6aad287ae 100644 --- a/electrum/payment_identifier.py +++ b/electrum/payment_identifier.py @@ -117,7 +117,7 @@ class PaymentIdentifier(Logger): # more than one of those may be set self.multiline_outputs = None self._is_max = False - self.bolt11 = None + self.bolt11 = None # type: Optional[Invoice] self.bip21 = None self.spk = None # @@ -406,7 +406,7 @@ class PaymentIdentifier(Logger): if invoice.get_amount_sat() != amount_sat: raise Exception("lnurl returned invoice with wrong amount") # this will change what is returned by get_fields_for_GUI - self.bolt11 = bolt11_invoice + self.bolt11 = invoice self.set_state(PaymentIdentifierState.AVAILABLE) except Exception as e: self.error = str(e)