plugin: Adding status to the pay plugin

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>

Rebase

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
This commit is contained in:
Vincenzo Palazzo
2021-09-06 10:51:21 +02:00
committed by Rusty Russell
parent 62ef403d20
commit 9d5c992fc8
8 changed files with 172 additions and 70 deletions

View File

@@ -1894,7 +1894,7 @@ static struct command_result *json_listpays(struct command *cmd,
const char *buf,
const jsmntok_t *params)
{
const char *invstring;
const char *invstring, *status_str;
struct sha256 *payment_hash;
struct out_req *req;
@@ -1903,6 +1903,7 @@ static struct command_result *json_listpays(struct command *cmd,
/* FIXME: parameter should be invstring now */
p_opt("bolt11", param_string, &invstring),
p_opt("payment_hash", param_sha256, &payment_hash),
p_opt("status", param_string, &status_str),
NULL))
return command_param_failed();
@@ -1915,6 +1916,8 @@ static struct command_result *json_listpays(struct command *cmd,
if (payment_hash)
json_add_sha256(req->js, "payment_hash", payment_hash);
if (status_str)
json_add_string(req->js, "status", status_str);
return send_outreq(cmd->plugin, req);
}