From 545220dfbcae6f46c3be36be34ccff3850f3bf59 Mon Sep 17 00:00:00 2001 From: Lagrang3 Date: Tue, 17 Dec 2024 15:05:15 +0100 Subject: [PATCH] xpay: add destination to output Changelog-Add: xpay: add destination to xpay success output when xpay-handle-pay is active. Signed-off-by: Lagrang3 --- plugins/xpay/xpay.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/xpay/xpay.c b/plugins/xpay/xpay.c index 78d7984bb..c37be71ee 100644 --- a/plugins/xpay/xpay.c +++ b/plugins/xpay/xpay.c @@ -374,6 +374,7 @@ static void payment_succeeded(struct payment *payment, const struct attempt *attempt) { struct json_stream *js; + struct node_id dst; /* Only succeed once */ if (payment->cmd) { @@ -384,6 +385,8 @@ static void payment_succeeded(struct payment *payment, /* Pay's schema expects these fields */ if (payment->pay_compat) { json_add_u64(js, "parts", payment->total_num_attempts); + node_id_from_pubkey(&dst, &payment->destination); + json_add_node_id(js, "destination", &dst); json_add_sha256(js, "payment_hash", &payment->payment_hash); json_add_string(js, "status", "complete"); json_add_u64(js, "created_at", (u64)payment->start_time.ts.tv_sec);