fix: cln nodemanager errors on failed transactions (#2865)
This commit is contained in:
+8
-3
@@ -304,14 +304,19 @@ class CoreLightningNode(Node):
|
|||||||
return [
|
return [
|
||||||
NodePayment(
|
NodePayment(
|
||||||
bolt11=pay.get("bolt11"),
|
bolt11=pay.get("bolt11"),
|
||||||
amount=pay["amount_msat"],
|
amount=pay.get("amount_msat", 0),
|
||||||
fee=int(pay["amount_msat"]) - int(pay["amount_sent_msat"]),
|
fee=int(pay.get("amount_msat", 0))
|
||||||
|
- int(pay.get("amount_sent_msat", 0)),
|
||||||
memo=pay.get("description"),
|
memo=pay.get("description"),
|
||||||
time=pay["created_at"],
|
time=pay["created_at"],
|
||||||
preimage=pay.get("preimage"),
|
preimage=pay.get("preimage"),
|
||||||
payment_hash=pay["payment_hash"],
|
payment_hash=pay["payment_hash"],
|
||||||
pending=pay["status"] != "complete",
|
pending=pay["status"] != "complete",
|
||||||
destination=await self.get_peer_info(pay["destination"]),
|
destination=(
|
||||||
|
await self.get_peer_info(pay.get("destination"))
|
||||||
|
if pay.get("destination")
|
||||||
|
else None
|
||||||
|
),
|
||||||
)
|
)
|
||||||
for pay in reversed(result["pays"])
|
for pay in reversed(result["pays"])
|
||||||
if pay["status"] != "failed"
|
if pay["status"] != "failed"
|
||||||
|
|||||||
Reference in New Issue
Block a user