mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
lightningd: correctly exit when an important-plugin fails to start.
This was found by tests/test_plugin.py::test_important_plugin and was NOT a flake! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-None: only just committed
This commit is contained in:
committed by
Christian Decker
parent
110ed3b1a9
commit
19300de58f
@@ -1938,7 +1938,7 @@ plugin_config(struct plugin *plugin)
|
||||
plugin->plugin_state = AWAITING_INIT_RESPONSE;
|
||||
}
|
||||
|
||||
void plugins_config(struct plugins *plugins)
|
||||
bool plugins_config(struct plugins *plugins)
|
||||
{
|
||||
struct plugin *p;
|
||||
list_for_each(&plugins->plugins, p, list) {
|
||||
@@ -1948,10 +1948,15 @@ void plugins_config(struct plugins *plugins)
|
||||
|
||||
/* Wait for them to configure, before continuing: large
|
||||
* nodes can take a while to startup! */
|
||||
if (plugins->startup)
|
||||
io_loop_with_timers(plugins->ld);
|
||||
if (plugins->startup) {
|
||||
/* This happens if an important plugin fails init,
|
||||
* or if they call shutdown now. */
|
||||
if (io_loop_with_timers(plugins->ld) == plugins->ld)
|
||||
return false;
|
||||
}
|
||||
|
||||
plugins->startup = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/** json_add_opt_plugins_array
|
||||
|
||||
Reference in New Issue
Block a user