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

Function plugins_init

lightningd/plugin.c:2041–2070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2039}
2040
2041void plugins_init(struct plugins *plugins)
2042{
2043 plugins->default_dir = path_join(plugins, plugins->ld->config_basedir, "plugins");
2044 plugins_add_default_dir(plugins);
2045
2046 if (plugins->dev_builtin_plugins_unimportant) {
2047 size_t i;
2048
2049 log_debug(plugins->log, "Builtin plugins now unimportant");
2050
2051 /* For each builtin plugin, check for a matching plugin
2052 * and make it unimportant. */
2053 for (i = 0; list_of_builtin_plugins[i]; ++i) {
2054 const char *name = list_of_builtin_plugins[i];
2055 struct plugin *p;
2056 list_for_each(&plugins->plugins, p, list) {
2057 if (plugin_paths_match(p->cmd, name)) {
2058 p->important = false;
2059 break;
2060 }
2061 }
2062 }
2063 }
2064
2065 setenv("LIGHTNINGD_PLUGIN", "1", 1);
2066 setenv("LIGHTNINGD_VERSION", version(), 1);
2067
2068 if (plugins_send_getmanifest(plugins, NULL))
2069 io_loop_with_timers(plugins->ld);
2070}
2071
2072static void plugin_config_cb(const char *buffer,
2073 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