Once they've all replied with their manifests, we can order them. */
| 125 | |
| 126 | /* Once they've all replied with their manifests, we can order them. */ |
| 127 | static void check_plugins_manifests(struct plugins *plugins, |
| 128 | struct logger *log) |
| 129 | { |
| 130 | struct plugin *plugin; |
| 131 | struct plugin **depfail; |
| 132 | |
| 133 | if (plugins_any_in_state(plugins, AWAITING_GETMANIFEST_RESPONSE)) |
| 134 | return; |
| 135 | |
| 136 | /* Now things are settled, try to order hooks. */ |
| 137 | depfail = plugin_hooks_make_ordered(tmpctx, log); |
| 138 | for (size_t i = 0; i < tal_count(depfail); i++) { |
| 139 | /* Only complain and free plugins! */ |
| 140 | if (depfail[i]->plugin_state != NEEDS_INIT) |
| 141 | continue; |
| 142 | plugin_kill(depfail[i], LOG_UNUSUAL, |
| 143 | "Cannot meet required hook dependencies"); |
| 144 | } |
| 145 | |
| 146 | /* Check that all the subscriptions are matched with real |
| 147 | * topics. */ |
| 148 | list_for_each(&plugins->plugins, plugin, list) { |
| 149 | plugin_check_subscriptions(plugin->plugins, plugin); |
| 150 | } |
| 151 | |
| 152 | /* As startup, we break out once all getmanifest are returned */ |
| 153 | if (plugins->startup) { |
| 154 | log_debug(plugins->ld->log, "io_break: %s", __func__); |
| 155 | io_break(plugins); |
| 156 | } else |
| 157 | /* Otherwise we go straight into configuring them */ |
| 158 | plugins_config(plugins); |
| 159 | } |
| 160 | |
| 161 | static void check_plugins_initted(struct plugins *plugins) |
| 162 | { |
no test coverage detected