From fed2d411399a0f3f46c1fffe5f6f67942e56b2e7 Mon Sep 17 00:00:00 2001 From: Kalle Rosenbaum Date: Thu, 26 Oct 2023 00:47:35 +0200 Subject: [PATCH] CLN: Handle optional invoice fields (#2056) --- lnbits/nodes/cln.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lnbits/nodes/cln.py b/lnbits/nodes/cln.py index 31a658cd5..880e21eea 100644 --- a/lnbits/nodes/cln.py +++ b/lnbits/nodes/cln.py @@ -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"],