CLN: Handle optional invoice fields (#2056)

This commit is contained in:
Kalle Rosenbaum 2023-10-26 00:47:35 +02:00 committed by GitHub
parent c8147bd83f
commit fed2d41139
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -310,10 +310,13 @@ class CoreLightningNode(Node):
return Page(
data=[
NodeInvoice(
bolt11=invoice["bolt11"],
amount=invoice["amount_msat"],
bolt11=invoice.get("bolt11") or invoice.get("bolt12"),
amount=(
invoice.get("amount_msat")
or invoice.get("amount_received_msat")
),
preimage=invoice.get("payment_preimage"),
memo=invoice["description"],
memo=invoice.get("description"),
paid_at=invoice.get("paid_at"),
expiry=invoice["expires_at"],
payment_hash=invoice["payment_hash"],