From 2fddfe3ffc256a9d0f7e9851f2e3227b3936f34c Mon Sep 17 00:00:00 2001 From: Simon Vrouwe Date: Wed, 15 Jun 2022 09:10:45 +0300 Subject: [PATCH] lightningd: don't increment plugin state to NEEDS_INIT when error in getmanifest Otherwise we hangs forever in startup when it was the last plugin, we would miss destroy_plugin --> check_plugins_manifests --> io_break e.g. when a plugin tries to register a bool option with a string as default value. --- lightningd/plugin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lightningd/plugin.c b/lightningd/plugin.c index 5cb6d08b6..b8564817b 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -1521,7 +1521,8 @@ static const char *plugin_parse_getmanifest_response(const char *buffer, if (!err) err = plugin_add_params(plugin); - plugin->plugin_state = NEEDS_INIT; + if (!err) + plugin->plugin_state = NEEDS_INIT; return err; }