list_transactions: fall back to extra.comment / memo when BOLT11 description is empty (#43)

This commit is contained in:
Richard 2026-06-02 10:36:40 +01:00 • committed by GitHub
commit 0204f8ff85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -425,7 +425,13 @@ async def _on_list_transactions(
{
"type": "outgoing" if p.is_out else "incoming",
"invoice": p.bolt11,
"description": invoice_data.description,
# Fallback chain so a human-readable description reaches
# the NWC client. Mirror of `_on_lookup_invoice`
"description": (
(p.extra or {}).get("comment")
or invoice_data.description
or p.memo
),
"description_hash": invoice_data.description_hash,
"preimage": p.preimage if is_settled or p.is_in else None,
"payment_hash": p.payment_hash,