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

Function plugins_init

lightningd/plugin.c:2029–2058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2027}
2028
2029void plugins_init(struct plugins *plugins)
2030{
2031 plugins->default_dir = path_join(plugins, plugins->ld->config_basedir, "plugins");
2032 plugins_add_default_dir(plugins);
2033
2034 if (plugins->dev_builtin_plugins_unimportant) {
2035 size_t i;
2036
2037 log_debug(plugins->log, "Builtin plugins now unimportant");
2038
2039 /* For each builtin plugin, check for a matching plugin
2040 * and make it unimportant. */
2041 for (i = 0; list_of_builtin_plugins[i]; ++i) {
2042 const char *name = list_of_builtin_plugins[i];
2043 struct plugin *p;
2044 list_for_each(&plugins->plugins, p, list) {
2045 if (plugin_paths_match(p->cmd, name)) {
2046 p->important = false;
2047 break;
2048 }
2049 }
2050 }
2051 }
2052
2053 setenv("LIGHTNINGD_PLUGIN", "1", 1);
2054 setenv("LIGHTNINGD_VERSION", version(), 1);
2055
2056 if (plugins_send_getmanifest(plugins, NULL))
2057 io_loop_with_timers(plugins->ld);
2058}
2059
2060static void plugin_config_cb(const char *buffer,
2061 const jsmntok_t *toks,

Callers 1

mainFunction · 0.70

Calls 6

path_joinFunction · 0.85
plugins_add_default_dirFunction · 0.85
plugin_paths_matchFunction · 0.85
versionFunction · 0.85
plugins_send_getmanifestFunction · 0.85
io_loop_with_timersFunction · 0.85

Tested by

no test coverage detected