mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
param: call param() all the time
Now call param() even for commands that don't accept any parameters. This is a bugfix of sorts. For example, before you could call: bitcoin-cli getinfo blah and the blah parameter would be ignored. Now you will get an error: "too many parameters: got 1, expected 0" Signed-off-by: Mark Beckwith <wythe@intrig.com>
This commit is contained in:
committed by
Christian Decker
parent
d91b94a812
commit
30b67c0334
@@ -78,6 +78,9 @@ static void json_stop(struct command *cmd,
|
||||
{
|
||||
struct json_result *response = new_json_result(cmd);
|
||||
|
||||
if (!param(cmd, buffer, params, NULL))
|
||||
return;
|
||||
|
||||
/* This can't have closed yet! */
|
||||
cmd->jcon->stop = true;
|
||||
json_add_string(response, NULL, "Shutting down");
|
||||
@@ -121,6 +124,9 @@ AUTODATA(json_command, &dev_rhash_command);
|
||||
static void json_crash(struct command *cmd UNUSED,
|
||||
const char *buffer UNUSED, const jsmntok_t *params UNUSED)
|
||||
{
|
||||
if (!param(cmd, buffer, params, NULL))
|
||||
return;
|
||||
|
||||
fatal("Crash at user request");
|
||||
}
|
||||
|
||||
@@ -137,6 +143,9 @@ static void json_getinfo(struct command *cmd,
|
||||
{
|
||||
struct json_result *response = new_json_result(cmd);
|
||||
|
||||
if (!param(cmd, buffer, params, NULL))
|
||||
return;
|
||||
|
||||
json_object_start(response, NULL);
|
||||
json_add_pubkey(response, "id", &cmd->ld->id);
|
||||
json_add_string(response, "alias", (const char *)cmd->ld->alias);
|
||||
|
||||
Reference in New Issue
Block a user