mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
plugins: Return command_param_failed() if param() fail
This commit is contained in:
committed by
Rusty Russell
parent
fe66b53fb9
commit
2d1a153975
@@ -46,7 +46,7 @@ static struct command_result *json_autocleaninvoice(struct command *cmd,
|
|||||||
p_opt_def("cycle_seconds", param_u64, &cycle, 3600),
|
p_opt_def("cycle_seconds", param_u64, &cycle, 3600),
|
||||||
p_opt_def("expired_by", param_u64, &exby, 86400),
|
p_opt_def("expired_by", param_u64, &exby, 86400),
|
||||||
NULL))
|
NULL))
|
||||||
return NULL;
|
return command_param_failed();
|
||||||
|
|
||||||
cycle_seconds = *cycle;
|
cycle_seconds = *cycle;
|
||||||
expired_by = *exby;
|
expired_by = *exby;
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ static struct command_result *json_fundchannel(struct command *cmd,
|
|||||||
p_opt_def("minconf", param_number, &fr->minconf, 1),
|
p_opt_def("minconf", param_number, &fr->minconf, 1),
|
||||||
p_opt("utxos", param_string, &fr->utxo_str),
|
p_opt("utxos", param_string, &fr->utxo_str),
|
||||||
NULL))
|
NULL))
|
||||||
return NULL;
|
return command_param_failed();
|
||||||
|
|
||||||
fr->funding_all = streq(fr->funding_str, "all");
|
fr->funding_all = streq(fr->funding_str, "all");
|
||||||
|
|
||||||
|
|||||||
@@ -636,7 +636,7 @@ static void setup_command_usage(const struct plugin_command *commands,
|
|||||||
|
|
||||||
usage_cmd->methodname = commands[i].name;
|
usage_cmd->methodname = commands[i].name;
|
||||||
res = commands[i].handle(usage_cmd, NULL, NULL);
|
res = commands[i].handle(usage_cmd, NULL, NULL);
|
||||||
assert(res == NULL);
|
assert(res == &complete);
|
||||||
assert(strmap_get(&usagemap, commands[i].name));
|
assert(strmap_get(&usagemap, commands[i].name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1027,7 +1027,7 @@ static struct command_result *json_pay(struct command *cmd,
|
|||||||
maxdelay_default),
|
maxdelay_default),
|
||||||
p_opt_def("exemptfee", param_msat, &exemptfee, AMOUNT_MSAT(5000)),
|
p_opt_def("exemptfee", param_msat, &exemptfee, AMOUNT_MSAT(5000)),
|
||||||
NULL))
|
NULL))
|
||||||
return NULL;
|
return command_param_failed();
|
||||||
|
|
||||||
b11 = bolt11_decode(cmd, b11str, NULL, &fail);
|
b11 = bolt11_decode(cmd, b11str, NULL, &fail);
|
||||||
if (!b11) {
|
if (!b11) {
|
||||||
@@ -1158,7 +1158,7 @@ static struct command_result *json_paystatus(struct command *cmd,
|
|||||||
if (!param(cmd, buf, params,
|
if (!param(cmd, buf, params,
|
||||||
p_opt("bolt11", param_string, &b11str),
|
p_opt("bolt11", param_string, &b11str),
|
||||||
NULL))
|
NULL))
|
||||||
return NULL;
|
return command_param_failed();
|
||||||
|
|
||||||
ret = json_out_new(NULL);
|
ret = json_out_new(NULL);
|
||||||
json_out_start(ret, NULL, '{');
|
json_out_start(ret, NULL, '{');
|
||||||
@@ -1280,7 +1280,7 @@ static struct command_result *json_listpays(struct command *cmd,
|
|||||||
if (!param(cmd, buf, params,
|
if (!param(cmd, buf, params,
|
||||||
p_opt("bolt11", param_string, &b11str),
|
p_opt("bolt11", param_string, &b11str),
|
||||||
NULL))
|
NULL))
|
||||||
return NULL;
|
return command_param_failed();
|
||||||
|
|
||||||
return send_outreq(cmd, "listsendpays",
|
return send_outreq(cmd, "listsendpays",
|
||||||
listsendpays_done, forward_error,
|
listsendpays_done, forward_error,
|
||||||
|
|||||||
Reference in New Issue
Block a user