plugins/pay: always include bolt11 (and description) in listpays.

We were setting it on the root, but that doesn't get handed to
sendpay.  Our schema doesn't *require* bolt11, either, so this was
missed (there could be a *bolt12* instead).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: JSON-RPC: `listpays` always includes `bolt11` or `bolt12` field.
This commit is contained in:
Rusty Russell
2022-04-04 12:26:52 +09:30
parent e47786da04
commit f51a3d8ef7
5 changed files with 27 additions and 12 deletions

View File

@@ -480,6 +480,13 @@ static struct command_result *listsendpays_done(struct command *cmd,
// First time we see the groupid we add it to the order
// array, so we can retrieve them in the correct order.
tal_arr_expand(&order, pm->sortkey);
} else {
/* Not all payments have bolt11/bolt12 or
* description, as an optimization */
if (!pm->invstring)
pm->invstring = tal_steal(pm, invstr);
if (!pm->description)
pm->description = json_get_member(buf, t, "description");
}
status = json_get_member(buf, t, "status");