mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
param: make command_fail/command_success WARN_UNUSED_RESULT.
This causes a compiler warning if we don't do something with the result (hopefully return immediately!). We use was_pending() to ignore the result in the case where we complete a command in a callback (thus really do want to ignore the result). This actually fixes one bug: we didn't return after command_fail in json_getroute with a bad seed value. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -280,8 +280,10 @@ bool param(struct command *cmd, const char *buffer,
|
||||
continue;
|
||||
}
|
||||
if (!param_add(¶ms, name, required, cbx, arg)) {
|
||||
command_fail(cmd, PARAM_DEV_ERROR,
|
||||
"developer error: param_add %s", name);
|
||||
/* We really do ignore this return! */
|
||||
if (command_fail(cmd, PARAM_DEV_ERROR,
|
||||
"developer error: param_add %s", name))
|
||||
;
|
||||
va_end(ap);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user