From cf2ba2a5bd7c971756187ff11d1a4a1db91b3efa Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 31 Mar 2023 15:03:44 +0200 Subject: [PATCH] qml: replace assert by exception --- electrum/gui/qml/qeinvoice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/electrum/gui/qml/qeinvoice.py b/electrum/gui/qml/qeinvoice.py index 7759d268b..894f880b3 100644 --- a/electrum/gui/qml/qeinvoice.py +++ b/electrum/gui/qml/qeinvoice.py @@ -632,10 +632,10 @@ class QEInvoiceParser(QEInvoice, QtEventListener): # assure no shenanigans with the bolt11 invoice we get back lninvoice = Invoice.from_bech32(invoice['pr']) - assert orig_amount * 1000 == lninvoice.amount_msat + if orig_amount * 1000 != lninvoice.amount_msat: + raise Exception('Unexpected amount in invoice, differs from lnurl-pay specified amount') - invoice = invoice['pr'] - self.recipient = invoice + self.recipient = invoice['pr'] @pyqtSlot() def save_invoice(self):