Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lightningd/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1819,6 +1819,11 @@ static const char *plugin_parse_getmanifest_response(const char *buffer,
return tal_fmt(plugin,
"Custom featurebits already present");
}

/* Store fset to allow to remove feature bits when init returns disabled */
plugin->fset = tal_dup_or_null(plugin, struct feature_set, fset);
} else {
plugin->fset = NULL;
}

custommsgtok = json_get_member(buffer, resulttok, "custommessages");
Expand Down Expand Up @@ -2148,6 +2153,10 @@ static void plugin_config_cb(const char *buffer,
JSON_SCAN_TAL(tmpctx, json_strdup, &disable)) == NULL) {
/* Don't get upset if this was a built-in! */
plugin->important = false;
if (plugin->fset)
/* We don't have those features anymore! */
feature_set_sub(plugin->plugins->ld->our_features,
plugin->fset);
plugin_kill(plugin, LOG_DBG,
"disabled itself at init: %s",
disable);
Expand Down
3 changes: 3 additions & 0 deletions lightningd/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ struct plugin {

/* Can this handle check commands? */
bool can_check;

/* custom feature-bits */
struct feature_set *fset;
};

/**
Expand Down
Loading