From a937e09f85174e83b607a735300cc90812da8368 Mon Sep 17 00:00:00 2001 From: jackstar12 <62219658+jackstar12@users.noreply.github.com> Date: Mon, 9 Oct 2023 13:02:22 +0200 Subject: [PATCH] fix: make bolt11 optional in `NodePayment` (#2005) --- lnbits/nodes/base.py | 2 +- lnbits/nodes/cln.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lnbits/nodes/base.py b/lnbits/nodes/base.py index 5b58517e6..74025fd78 100644 --- a/lnbits/nodes/base.py +++ b/lnbits/nodes/base.py @@ -104,7 +104,7 @@ class NodePayment(BaseModel): fee: Optional[int] = None memo: Optional[str] = None time: int - bolt11: str + bolt11: Optional[str] = None preimage: Optional[str] payment_hash: str expiry: Optional[float] = None diff --git a/lnbits/nodes/cln.py b/lnbits/nodes/cln.py index 235527a0d..31a658cd5 100644 --- a/lnbits/nodes/cln.py +++ b/lnbits/nodes/cln.py @@ -271,7 +271,7 @@ class CoreLightningNode(Node): result = await self.ln_rpc("listpays") return [ NodePayment( - bolt11=pay["bolt11"], + bolt11=pay.get("bolt11"), amount=pay["amount_msat"], fee=int(pay["amount_msat"]) - int(pay["amount_sent_msat"]), memo=pay.get("description"),