Browse Source

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 <rusty@rustcorp.com.au>
travis-debug
Rusty Russell 5 years ago
committed by Christian Decker
parent
commit
f1bc0b21f1
  1. 14
      plugins/pay.c

14
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");

Loading…
Cancel
Save