From 4e8db98d1b4f42e8c244f536da81086ed1b3309c Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 5 May 2025 14:07:49 +0200 Subject: [PATCH] fix: SendTab not updating amount after text input change When paying a 0 amount invoice, after clicking pay the entered amount will get saved in `PaymentIdentifier.boltPaymentIdentifier.bolt11.amount_msat`. However if the user clicks cancel instead of pay, and then changes the amount, amount_msat will not get updated, as it is not None anymore. If the user clicks pay again, it will pay the previously entered wrong amount. This checks the `LnAddr` amount instead of the `Invoice` amount. --- electrum/payment_identifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electrum/payment_identifier.py b/electrum/payment_identifier.py index 9020c1c17..36044b7ba 100644 --- a/electrum/payment_identifier.py +++ b/electrum/payment_identifier.py @@ -689,7 +689,7 @@ def invoice_from_payment_identifier( invoice = pi.bolt11 if not invoice: return - if invoice.amount_msat is None: + if invoice._lnaddr.get_amount_msat() is None: invoice.set_amount_msat(int(amount_sat * 1000)) return invoice else: