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

Function plugins_init

lightningd/plugin.c:1768–1803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1766}
1767
1768void plugins_init(struct plugins *plugins)
1769{
1770 plugins->default_dir = path_join(plugins, plugins->ld->config_basedir, "plugins");
1771 plugins_add_default_dir(plugins);
1772
1773#if DEVELOPER
1774 if (plugins->dev_builtin_plugins_unimportant) {
1775 size_t i;
1776
1777 log_debug(plugins->log, "Builtin plugins now unimportant");
1778
1779 /* For each builtin plugin, check for a matching plugin
1780 * and make it unimportant. */
1781 for (i = 0; list_of_builtin_plugins[i]; ++i) {
1782 const char *name = list_of_builtin_plugins[i];
1783 struct plugin *p;
1784 list_for_each(&plugins->plugins, p, list) {
1785 if (plugin_paths_match(p->cmd, name)) {
1786 p->important = false;
1787 break;
1788 }
1789 }
1790 }
1791 }
1792#endif /* DEVELOPER */
1793
1794 setenv("LIGHTNINGD_PLUGIN", "1", 1);
1795 setenv("LIGHTNINGD_VERSION", version(), 1);
1796
1797 if (plugins_send_getmanifest(plugins, NULL)) {
1798 void *ret;
1799 ret = io_loop_with_timers(plugins->ld);
1800 log_debug(plugins->ld->log, "io_loop_with_timers: %s", __func__);
1801 assert(ret == plugins);
1802 }
1803}
1804
1805static void plugin_config_cb(const char *buffer,
1806 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
plugins_send_getmanifestFunction · 0.85
io_loop_with_timersFunction · 0.85
versionFunction · 0.50

Tested by

no test coverage detected