mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 22:45:27 +01:00
lightningd: remove deprecated 'description' parameter.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Removed: JSON: `sendpay` `description` parameter removed (renamed to `label` in 0.7.0).
This commit is contained in:
parent
610aa0b8e3
commit
0007af0a4e
1 changed files with 11 additions and 43 deletions
|
@ -1206,53 +1206,21 @@ static struct command_result *json_sendpay(struct command *cmd,
|
|||
struct sha256 *rhash;
|
||||
struct route_hop *route;
|
||||
struct amount_msat *msat;
|
||||
const char *b11str, *label = NULL;
|
||||
const char *b11str, *label;
|
||||
u64 *partid;
|
||||
struct secret *payment_secret;
|
||||
|
||||
/* For generating help, give new-style. */
|
||||
if (!params || !deprecated_apis) {
|
||||
if (!param(cmd, buffer, params,
|
||||
p_req("route", param_array, &routetok),
|
||||
p_req("payment_hash", param_sha256, &rhash),
|
||||
p_opt("label", param_escaped_string, &label),
|
||||
p_opt("msatoshi", param_msat, &msat),
|
||||
p_opt("bolt11", param_string, &b11str),
|
||||
p_opt("payment_secret", param_secret,
|
||||
&payment_secret),
|
||||
p_opt_def("partid", param_u64, &partid, 0),
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
} else if (params->type == JSMN_ARRAY) {
|
||||
if (!param(cmd, buffer, params,
|
||||
p_req("route", param_array, &routetok),
|
||||
p_req("payment_hash", param_sha256, &rhash),
|
||||
p_opt("label_or_description", param_escaped_string, &label),
|
||||
p_opt("msatoshi", param_msat, &msat),
|
||||
p_opt("bolt11", param_string, &b11str),
|
||||
p_opt("payment_secret", param_secret,
|
||||
&payment_secret),
|
||||
p_opt_def("partid", param_u64, &partid, 0),
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
} else {
|
||||
const char *desc = NULL;
|
||||
if (!param(cmd, buffer, params,
|
||||
p_req("route", param_array, &routetok),
|
||||
p_req("payment_hash", param_sha256, &rhash),
|
||||
p_opt("label", param_escaped_string, &label),
|
||||
p_opt("description", param_escaped_string, &desc),
|
||||
p_opt("msatoshi", param_msat, &msat),
|
||||
p_opt("bolt11", param_string, &b11str),
|
||||
p_opt("payment_secret", param_secret,
|
||||
&payment_secret),
|
||||
p_opt_def("partid", param_u64, &partid, 0),
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
|
||||
if (!label && desc)
|
||||
label = desc;
|
||||
}
|
||||
if (!param(cmd, buffer, params,
|
||||
p_req("route", param_array, &routetok),
|
||||
p_req("payment_hash", param_sha256, &rhash),
|
||||
p_opt("label", param_escaped_string, &label),
|
||||
p_opt("msatoshi", param_msat, &msat),
|
||||
p_opt("bolt11", param_string, &b11str),
|
||||
p_opt("payment_secret", param_secret, &payment_secret),
|
||||
p_opt_def("partid", param_u64, &partid, 0),
|
||||
NULL))
|
||||
return command_param_failed();
|
||||
|
||||
if (routetok->size == 0)
|
||||
return command_fail(cmd, JSONRPC2_INVALID_PARAMS, "Empty route");
|
||||
|
|
Loading…
Add table
Reference in a new issue