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

Function plugin_config_cb

lightningd/plugin.c:2072–2104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2070}
2071
2072static void plugin_config_cb(const char *buffer,
2073 const jsmntok_t *toks,
2074 const jsmntok_t *idtok,
2075 struct plugin *plugin)
2076{
2077 const char *disable;
2078
2079 /* Plugin can also disable itself at this stage. */
2080 if (json_scan(tmpctx, buffer, toks, "{result:{disable:%}}",
2081 JSON_SCAN_TAL(tmpctx, json_strdup, &disable)) == NULL) {
2082 /* Don't get upset if this was a built-in! */
2083 plugin->important = false;
2084 if (plugin->fset)
2085 /* We don't have those features anymore! */
2086 feature_set_sub(plugin->plugins->ld->our_features,
2087 plugin->fset);
2088 plugin_kill(plugin, LOG_DBG,
2089 "disabled itself at init: %s",
2090 disable);
2091 return;
2092 }
2093
2094 plugin->plugin_state = INIT_COMPLETE;
2095 plugin->timeout_timer = tal_free(plugin->timeout_timer);
2096 if (plugin->start_cmd) {
2097 plugin_cmd_succeeded(plugin->start_cmd, plugin);
2098 plugin->start_cmd = NULL;
2099 }
2100 if (tal_count(plugin->custom_msgs))
2101 tell_connectd_custommsgs(plugin->plugins);
2102 notify_plugin_started(plugin->plugins->ld, plugin);
2103 check_plugins_initted(plugin->plugins);
2104}
2105
2106static void json_add_plugin_val(struct json_stream *stream,
2107 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