payment_identifier: fix setting self.bolt11 to invoice in bip21 LN alt case
This commit is contained in:
@@ -253,13 +253,9 @@ class PaymentIdentifier(Logger):
|
|||||||
bolt11 = out.get('lightning')
|
bolt11 = out.get('lightning')
|
||||||
if bolt11:
|
if bolt11:
|
||||||
try:
|
try:
|
||||||
lndecode(bolt11)
|
self.bolt11 = Invoice.from_bech32(bolt11)
|
||||||
# if we get here, we have a usable bolt11
|
except InvoiceError as e:
|
||||||
self.bolt11 = bolt11
|
self.logger.debug(self._get_error_from_invoiceerror(e))
|
||||||
except LnInvoiceException as e:
|
|
||||||
self.logger.debug(_("Error parsing Lightning invoice") + f":\n{e}")
|
|
||||||
except IncompatibleOrInsaneFeatures as e:
|
|
||||||
self.logger.debug(_("Invoice requires unknown or incompatible Lightning feature") + f":\n{e!r}")
|
|
||||||
self.set_state(PaymentIdentifierState.AVAILABLE)
|
self.set_state(PaymentIdentifierState.AVAILABLE)
|
||||||
elif scriptpubkey := self.parse_output(text):
|
elif scriptpubkey := self.parse_output(text):
|
||||||
self._type = PaymentIdentifierType.SPK
|
self._type = PaymentIdentifierType.SPK
|
||||||
@@ -671,7 +667,7 @@ def invoice_from_payment_identifier(
|
|||||||
wallet: 'Abstract_Wallet',
|
wallet: 'Abstract_Wallet',
|
||||||
amount_sat: int,
|
amount_sat: int,
|
||||||
message: str = None
|
message: str = None
|
||||||
):
|
) -> Optional[Invoice]:
|
||||||
if pi.is_lightning():
|
if pi.is_lightning():
|
||||||
invoice = pi.bolt11
|
invoice = pi.bolt11
|
||||||
if not invoice:
|
if not invoice:
|
||||||
|
|||||||
Reference in New Issue
Block a user