mirror of
https://github.com/lnbits/lnbits.git
synced 2025-06-29 02:01:35 +02:00
CLN: Handle optional invoice fields (#2056)
This commit is contained in:
@ -310,10 +310,13 @@ class CoreLightningNode(Node):
|
|||||||
return Page(
|
return Page(
|
||||||
data=[
|
data=[
|
||||||
NodeInvoice(
|
NodeInvoice(
|
||||||
bolt11=invoice["bolt11"],
|
bolt11=invoice.get("bolt11") or invoice.get("bolt12"),
|
||||||
amount=invoice["amount_msat"],
|
amount=(
|
||||||
|
invoice.get("amount_msat")
|
||||||
|
or invoice.get("amount_received_msat")
|
||||||
|
),
|
||||||
preimage=invoice.get("payment_preimage"),
|
preimage=invoice.get("payment_preimage"),
|
||||||
memo=invoice["description"],
|
memo=invoice.get("description"),
|
||||||
paid_at=invoice.get("paid_at"),
|
paid_at=invoice.get("paid_at"),
|
||||||
expiry=invoice["expires_at"],
|
expiry=invoice["expires_at"],
|
||||||
payment_hash=invoice["payment_hash"],
|
payment_hash=invoice["payment_hash"],
|
||||||
|
Reference in New Issue
Block a user