mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-08 16:44:22 +01:00
lightningd/plugin.c: Add a --dev-builtin-plugins-unimportant for developers who want to mess around with the builtin plugins.
This commit is contained in:
committed by
neil saitug
parent
1aa076845a
commit
1ded3fc52f
@@ -57,6 +57,9 @@ struct plugins *plugins_new(const tal_t *ctx, struct log_book *log_book,
|
||||
p->json_cmds = tal_arr(p, struct command *, 0);
|
||||
p->blacklist = tal_arr(p, const char *, 0);
|
||||
p->shutdown = false;
|
||||
#if DEVELOPER
|
||||
p->dev_builtin_plugins_unimportant = false;
|
||||
#endif /* DEVELOPER */
|
||||
uintmap_init(&p->pending_requests);
|
||||
memleak_add_helper(p, memleak_help_pending_requests);
|
||||
|
||||
@@ -1328,6 +1331,27 @@ void plugins_init(struct plugins *plugins)
|
||||
plugins->default_dir = path_join(plugins, plugins->ld->config_basedir, "plugins");
|
||||
plugins_add_default_dir(plugins);
|
||||
|
||||
#if DEVELOPER
|
||||
if (plugins->dev_builtin_plugins_unimportant) {
|
||||
size_t i;
|
||||
|
||||
log_debug(plugins->log, "Builtin plugins now unimportant");
|
||||
|
||||
/* For each builtin plugin, check for a matching plugin
|
||||
* and make it unimportant. */
|
||||
for (i = 0; list_of_builtin_plugins[i]; ++i) {
|
||||
const char *name = list_of_builtin_plugins[i];
|
||||
struct plugin *p;
|
||||
list_for_each(&plugins->plugins, p, list) {
|
||||
if (plugin_paths_match(p->cmd, name)) {
|
||||
p->important = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* DEVELOPER */
|
||||
|
||||
setenv("LIGHTNINGD_PLUGIN", "1", 1);
|
||||
setenv("LIGHTNINGD_VERSION", version(), 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user