lightningd: have plugin-disable be more persistent.

The previous implementation was a bit lazy: in particular, since we didn't
remember the disabled plugins, we would load them on rescan.

Changelog-Changed: config: the `plugin-disable` option works even if specified before the plugin is found.
This commit is contained in:
Rusty Russell
2020-05-05 10:45:21 +09:30
parent 20abcd3ba3
commit 24063ca972
6 changed files with 86 additions and 17 deletions

View File

@@ -100,6 +100,9 @@ struct plugins {
/* If there are json commands waiting for plugin resolutions. */
struct command **json_cmds;
/* Blacklist of plugins from --disable-plugin */
const char **blacklist;
};
/* The value of a plugin option, which can have different types.
@@ -191,10 +194,18 @@ bool plugin_paths_match(const char *cmd, const char *name);
* @param plugins: Plugin context
* @param arg: The basename or fullname of the executable for this plugin
*/
bool plugin_remove(struct plugins *plugins, const char *name);
void plugin_blacklist(struct plugins *plugins, const char *name);
/**
* Kick of initialization of a plugin.
* Is a plugin disabled?.
*
* @param plugins: Plugin context
* @param arg: The basename or fullname of the executable for this plugin
*/
bool plugin_blacklisted(struct plugins *plugins, const char *name);
/**
* Kick off initialization of a plugin.
*
* Returns error string, or NULL.
*/