MCPcopy Create free account
hub / github.com/ElementsProject/lightning / check_plugins_manifests

Function check_plugins_manifests

lightningd/plugin.c:127–159  ·  view source on GitHub ↗

Once they've all replied with their manifests, we can order them. */

Source from the content-addressed store, hash-verified

125
126/* Once they've all replied with their manifests, we can order them. */
127static 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
161static void check_plugins_initted(struct plugins *plugins)
162{

Callers 2

destroy_pluginFunction · 0.85
plugin_manifest_cbFunction · 0.85

Calls 6

plugins_any_in_stateFunction · 0.85
plugin_killFunction · 0.85
io_breakFunction · 0.85
plugins_configFunction · 0.70

Tested by

no test coverage detected