From 7391a1039dd4c245b9a4c5aaf0e7b78c7e4b120f Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Thu, 27 Mar 2025 11:09:31 +0100 Subject: [PATCH] qml: don't confuse second payment to same address with previous unconfirmed payment to that address QEInvoiceParser creates a zero amount output invoice when pasting an address, which would return the wrong status when calling wallet.get_invoice_status() (there is some address heuristic in wallet._is_onchain_invoice_paid which is associating with the previous payment) --- electrum/gui/qml/qeinvoice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/electrum/gui/qml/qeinvoice.py b/electrum/gui/qml/qeinvoice.py index ac7bbbf7f..061c2aca1 100644 --- a/electrum/gui/qml/qeinvoice.py +++ b/electrum/gui/qml/qeinvoice.py @@ -167,6 +167,9 @@ class QEInvoice(QObject, QtEventListener): def status(self): if not self._effectiveInvoice: return PR_UNKNOWN + if self.invoiceType == QEInvoice.Type.OnchainInvoice and self._effectiveInvoice.get_amount_sat() == 0: + # no amount set, not a final invoice, get_invoice_status would be wrong + return PR_UNPAID return self._wallet.wallet.get_invoice_status(self._effectiveInvoice) @pyqtProperty(str, notify=statusChanged)