| 538 | } |
| 539 | |
| 540 | static struct command_result *json_listpays(struct command *cmd, |
| 541 | const char *buf, |
| 542 | const jsmntok_t *params) |
| 543 | { |
| 544 | const char *invstring, *status_str; |
| 545 | struct sha256 *payment_hash; |
| 546 | struct out_req *req; |
| 547 | |
| 548 | /* FIXME: would be nice to parse as a bolt11 so check worked in future */ |
| 549 | if (!param(cmd, buf, params, |
| 550 | /* FIXME: parameter should be invstring now */ |
| 551 | p_opt("bolt11", param_string, &invstring), |
| 552 | p_opt("payment_hash", param_sha256, &payment_hash), |
| 553 | p_opt("status", param_string, &status_str), |
| 554 | NULL)) |
| 555 | return command_param_failed(); |
| 556 | |
| 557 | req = jsonrpc_request_start(cmd->plugin, cmd, "listsendpays", |
| 558 | listsendpays_done, forward_error, |
| 559 | cast_const(char *, invstring)); |
| 560 | if (invstring) |
| 561 | json_add_string(req->js, "bolt11", invstring); |
| 562 | |
| 563 | if (payment_hash) |
| 564 | json_add_sha256(req->js, "payment_hash", payment_hash); |
| 565 | |
| 566 | if (status_str) |
| 567 | json_add_string(req->js, "status", status_str); |
| 568 | return send_outreq(cmd->plugin, req); |
| 569 | } |
| 570 | |
| 571 | #if DEVELOPER |
| 572 | static void memleak_mark_payments(struct plugin *p, struct htable *memtable) |
nothing calls this directly
no test coverage detected