From de148febb1d630f7dfd28ff742da627a8711644f Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 2 Jun 2023 12:06:04 +0930 Subject: [PATCH] lightningd: make `--clear-plugins` override prior plugin configvars. It's an obscure command, but this we won't see old plugin commands in listconfigs (once it uses configvars). Signed-off-by: Rusty Russell --- lightningd/options.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lightningd/options.c b/lightningd/options.c index b459daee8..b45265aeb 100644 --- a/lightningd/options.c +++ b/lightningd/options.c @@ -557,6 +557,13 @@ static char *opt_add_plugin_dir(const char *arg, struct lightningd *ld) static char *opt_clear_plugins(struct lightningd *ld) { clear_plugins(ld->plugins); + + /* Remove from configvars too! */ + for (size_t i = 0; i < tal_count(ld->configvars); i++) { + if (streq(ld->configvars[i]->optvar, "plugin") + || streq(ld->configvars[i]->optvar, "plugin-dir")) + ld->configvars[i]->overridden = true; + } return NULL; }