mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
json-rpc: make commands return 'struct command_result *'.
Usually, this means they return 'command_param_failed()' if param() fails, and changing 'command_success(); return;' to 'return command_success()'. Occasionally, it's more complex: there's a command_its_complicated() for the case where we can't exactly determine what the status is, but it should be considered a last resort. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -49,6 +49,12 @@ struct command_result *command_fail(struct command *cmd UNNEEDED, int code UNNEE
|
||||
struct command_result *command_failed(struct command *cmd UNNEEDED,
|
||||
struct json_stream *result UNNEEDED)
|
||||
{ fprintf(stderr, "command_failed called!\n"); abort(); }
|
||||
/* Generated stub for command_its_complicated */
|
||||
struct command_result *command_its_complicated(void)
|
||||
{ fprintf(stderr, "command_its_complicated called!\n"); abort(); }
|
||||
/* Generated stub for command_param_failed */
|
||||
struct command_result *command_param_failed(void)
|
||||
{ fprintf(stderr, "command_param_failed called!\n"); abort(); }
|
||||
/* Generated stub for command_still_pending */
|
||||
struct command_result *command_still_pending(struct command *cmd UNNEEDED)
|
||||
{ fprintf(stderr, "command_still_pending called!\n"); abort(); }
|
||||
|
||||
Reference in New Issue
Block a user