listpays mod 1: add destination inside the response when bolt11 is null

Changelog-Added: JSON-RPC: `listpays` now lists the `destination` if it was provided (e.g., via the `pay` plugin or `keysend` plugin)
This commit is contained in:
Vincenzo Palazzo
2020-07-31 17:19:22 +02:00
committed by Christian Decker
parent 700897f06e
commit 1521c29fcf
6 changed files with 32 additions and 5 deletions

View File

@@ -1041,6 +1041,9 @@ static struct command_result *payment_createonion_success(struct command *cmd,
if (p->bolt11)
json_add_string(req->js, "bolt11", p->bolt11);
if (p->destination)
json_add_node_id(req->js, "destination", p->destination);
send_outreq(p->plugin, req);
return command_still_pending(cmd);
}