From f1bc0b21f171ee0dfce40159318e5683e9050a11 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 12 Dec 2019 10:25:45 +1030 Subject: [PATCH] plugins: listpays ignores pre-0.7.0 or manual sendpay payments w/ no bolt11. The pay plugin has been supplying the bolt11 string since 0.7.0, so only ancient "pay" commands would be omitted by this change. You can create a no-bolt11 "sendpay" manually, but then you'll find it in 'listsendpays'. Changelog-Removed: JSON: `listpays` won't shown payments made via sendpay without a bolt11 string, or before 0.7.0. Signed-off-by: Rusty Russell --- plugins/pay.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/plugins/pay.c b/plugins/pay.c index 3dfc0a4dc..1cdd33937 100644 --- a/plugins/pay.c +++ b/plugins/pay.c @@ -1300,18 +1300,10 @@ static struct command_result *listsendpays_done(struct command *cmd, const jsmntok_t *status, *b11; json_out_start(ret, NULL, '{'); - /* Old payments didn't have bolt11 field */ b11 = copy_member(ret, buf, t, "bolt11"); - if (!b11) { - if (b11str) { - /* If it's a single query, we can fake it */ - json_out_addstr(ret, "bolt11", b11str); - } else { - copy_member(ret, buf, t, "payment_hash"); - copy_member(ret, buf, t, "destination"); - copy_member(ret, buf, t, "amount_msat"); - } - } + /* Old (or manual) payments didn't have bolt11 field */ + if (!b11) + continue; /* listsendpays might say it failed, but we're still retrying */ status = json_get_member(buf, t, "status");