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:
Rusty Russell
2024-04-04 14:06:11 +10:30
parent e3c4bdf209
commit cf72fb418e
9 changed files with 41 additions and 33 deletions

View File

@@ -601,6 +601,11 @@ bool command_check_only(const struct command *cmd)
return false;
}
struct command_result *command_check_done(struct command *cmd)
{
abort();
}
void command_set_usage(struct command *cmd, const char *usage TAKES)
{
usage = tal_strdup(NULL, usage);