list_transactions: fall back to extra.comment / memo when BOLT11 description is empty (#43)
This commit is contained in:
parent
16a0ec8ab2
commit
0204f8ff85
1 changed files with 7 additions and 1 deletions
8
tasks.py
8
tasks.py
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue