From c6a0018c52b17858d178b3272fa0c336f805f0c1 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Tue, 8 Oct 2024 10:33:08 +0200 Subject: [PATCH] payment_identifier: regard BIP21 without address and without bolt11 invalid --- electrum/payment_identifier.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/electrum/payment_identifier.py b/electrum/payment_identifier.py index 1161dfb63..9020c1c17 100644 --- a/electrum/payment_identifier.py +++ b/electrum/payment_identifier.py @@ -266,6 +266,10 @@ class PaymentIdentifier(Logger): self.bolt11.outputs = [PartialTxOutput.from_address_and_value(bip21_address, amount)] except InvoiceError as e: self.logger.debug(self._get_error_from_invoiceerror(e)) + elif not self.bip21.get('address'): + # no address and no bolt11, invalid + self.set_state(PaymentIdentifierState.INVALID) + return self.set_state(PaymentIdentifierState.AVAILABLE) elif self.parse_output(text)[0]: scriptpubkey, is_address = self.parse_output(text)