libplugin: make init return a string.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: libplugin: init can return a non-NULL string to disable the plugin.
This commit is contained in:
Rusty Russell
2021-01-13 13:30:24 +10:30
committed by Christian Decker
parent 529ae0d766
commit 27c006f7aa
11 changed files with 69 additions and 34 deletions

View File

@@ -870,12 +870,14 @@ static void wait_and_check_bitcoind(struct plugin *p)
tal_free(cmd);
}
static void init(struct plugin *p, const char *buffer UNUSED,
const jsmntok_t *config UNUSED)
static const char *init(struct plugin *p, const char *buffer UNUSED,
const jsmntok_t *config UNUSED)
{
wait_and_check_bitcoind(p);
plugin_log(p, LOG_INFORM,
"bitcoin-cli initialized and connected to bitcoind.");
return NULL;
}
static const struct plugin_command commands[] = {