From db84b984e5d4fa356c4d96f7d657378891cbea15 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 29 Sep 2021 12:08:27 +0200 Subject: [PATCH] pay: Add `groupid` to the payment struct --- plugins/libplugin-pay.c | 3 +++ plugins/libplugin-pay.h | 1 + 2 files changed, 4 insertions(+) diff --git a/plugins/libplugin-pay.c b/plugins/libplugin-pay.c index d3b2ff041..8fad8c585 100644 --- a/plugins/libplugin-pay.c +++ b/plugins/libplugin-pay.c @@ -89,6 +89,7 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd, p->id = parent->id; p->local_id = parent->local_id; p->local_offer_id = parent->local_offer_id; + p->groupid = parent->groupid; } else { assert(cmd != NULL); p->partid = 0; @@ -100,6 +101,7 @@ struct payment *payment_new(tal_t *ctx, struct command *cmd, /* Caller must set this. */ p->local_id = NULL; p->local_offer_id = NULL; + p->groupid = 0; } /* Initialize all modifier data so we can point to the fields when @@ -1525,6 +1527,7 @@ static struct command_result *payment_createonion_success(struct command *cmd, json_array_end(req->js); json_add_num(req->js, "partid", p->partid); + json_add_u64(req->js, "groupid", p->groupid); if (p->label) json_add_string(req->js, "label", p->label); diff --git a/plugins/libplugin-pay.h b/plugins/libplugin-pay.h index 1165fd1bf..2daf1f73f 100644 --- a/plugins/libplugin-pay.h +++ b/plugins/libplugin-pay.h @@ -184,6 +184,7 @@ struct payment { /* Payment secret, from the invoice if any. */ struct secret *payment_secret; + u64 groupid; u32 partid; u32 next_partid;