mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
plugin: Move the notification subscription check into a second phase
A plugin might subscribe to a notification topic that is only registered by another plugin later, so push the check to that consistency check phase where we do hook ordering as well.
This commit is contained in:
parent
083b41f090
commit
f77a0bcd8f
@ -126,6 +126,7 @@ static void plugin_check_subscriptions(struct plugins *plugins,
|
||||
/* Once they've all replied with their manifests, we can order them. */
|
||||
static void check_plugins_manifests(struct plugins *plugins)
|
||||
{
|
||||
struct plugin *plugin;
|
||||
struct plugin **depfail;
|
||||
|
||||
if (plugins_any_in_state(plugins, AWAITING_GETMANIFEST_RESPONSE))
|
||||
@ -141,6 +142,12 @@ static void check_plugins_manifests(struct plugins *plugins)
|
||||
"Cannot meet required hook dependencies");
|
||||
}
|
||||
|
||||
/* Check that all the subscriptions are matched with real
|
||||
* topics. */
|
||||
list_for_each(&plugins->plugins, plugin, list) {
|
||||
plugin_check_subscriptions(plugin->plugins, plugin);
|
||||
}
|
||||
|
||||
/* As startup, we break out once all getmanifest are returned */
|
||||
if (plugins->startup)
|
||||
io_break(plugins);
|
||||
@ -1356,8 +1363,6 @@ static const char *plugin_parse_getmanifest_response(const char *buffer,
|
||||
if (!err)
|
||||
err = plugin_add_params(plugin);
|
||||
|
||||
plugin_check_subscriptions(plugin->plugins, plugin);
|
||||
|
||||
plugin->plugin_state = NEEDS_INIT;
|
||||
return err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user