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.
This commit is contained in:
Simon Vrouwe 2022-06-15 09:10:45 +03:00 committed by neil saitug
parent 981fd2326a
commit 2fddfe3ffc

View file

@ -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;
}