libplugin: add no-op command complete function

When an RPC originates from a plugin, and there's no associated command,
it's useful to be able to signal that you're finished.
This commit is contained in:
niftynei 2021-04-19 14:26:23 -05:00 committed by Rusty Russell
parent 7bc78c45b4
commit 15e83925e8
2 changed files with 8 additions and 0 deletions

View file

@ -106,6 +106,10 @@ struct command_result *command_param_failed(void)
return &complete;
}
struct command_result *command_done(void)
{
return &complete;
}
static void ld_send(struct plugin *plugin, struct json_stream *stream)
{

View file

@ -219,6 +219,10 @@ struct command_result *forward_result(struct command *cmd,
* send_req() path. */
struct command_result *timer_complete(struct plugin *p);
/* Signals that we've completed a command. Useful for when
* there's no `cmd` present */
struct command_result *command_done(void);
/* Access timer infrastructure to add a timer.
*
* Freeing this releases the timer, otherwise it's freed after @cb