param: generalize check handling a little.
We want to extend it to plugins, and we want it to be allowed to be async for more power, so rather than not completing the cmd if we're checking, do it in command_check_done() and call it. This is cleaner than the special case we had before, and allows check to us all the normal jsonrpc mechanisms, especially async requests (which we'll need if we want to hand check requests to plugins!). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -57,4 +57,9 @@ void command_set_usage(struct command *cmd, const char *usage);
|
||||
/* Also caller supplied: is this invoked simply to check parameters? */
|
||||
bool command_check_only(const struct command *cmd);
|
||||
|
||||
/* To return after param_check() succeeds but we're still
|
||||
* command_check_only(cmd). */
|
||||
struct command_result *command_check_done(struct command *cmd)
|
||||
WARN_UNUSED_RESULT;
|
||||
|
||||
#endif /* LIGHTNING_COMMON_JSON_COMMAND_H */
|
||||
|
||||
Reference in New Issue
Block a user