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

Function plugin_config_cb

lightningd/plugin.c:2060–2092  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2058}
2059
2060static void plugin_config_cb(const char *buffer,
2061 const jsmntok_t *toks,
2062 const jsmntok_t *idtok,
2063 struct plugin *plugin)
2064{
2065 const char *disable;
2066
2067 /* Plugin can also disable itself at this stage. */
2068 if (json_scan(tmpctx, buffer, toks, "{result:{disable:%}}",
2069 JSON_SCAN_TAL(tmpctx, json_strdup, &disable)) == NULL) {
2070 /* Don't get upset if this was a built-in! */
2071 plugin->important = false;
2072 if (plugin->fset)
2073 /* We don't have those features anymore! */
2074 feature_set_sub(plugin->plugins->ld->our_features,
2075 plugin->fset);
2076 plugin_kill(plugin, LOG_DBG,
2077 "disabled itself at init: %s",
2078 disable);
2079 return;
2080 }
2081
2082 plugin->plugin_state = INIT_COMPLETE;
2083 plugin->timeout_timer = tal_free(plugin->timeout_timer);
2084 if (plugin->start_cmd) {
2085 plugin_cmd_succeeded(plugin->start_cmd, plugin);
2086 plugin->start_cmd = NULL;
2087 }
2088 if (tal_count(plugin->custom_msgs))
2089 tell_connectd_custommsgs(plugin->plugins);
2090 notify_plugin_started(plugin->plugins->ld, plugin);
2091 check_plugins_initted(plugin->plugins);
2092}
2093
2094static void json_add_plugin_val(struct json_stream *stream,
2095 const struct opt_table *ot,

Callers

nothing calls this directly

Calls 8

feature_set_subFunction · 0.85
plugin_killFunction · 0.85
tal_freeFunction · 0.85
plugin_cmd_succeededFunction · 0.85
tell_connectd_custommsgsFunction · 0.85
notify_plugin_startedFunction · 0.85
check_plugins_inittedFunction · 0.85
json_scanFunction · 0.50

Tested by

no test coverage detected