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

Function plugin_config_cb

lightningd/plugin.c:1805–1830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1803}
1804
1805static void plugin_config_cb(const char *buffer,
1806 const jsmntok_t *toks,
1807 const jsmntok_t *idtok,
1808 struct plugin *plugin)
1809{
1810 const char *disable;
1811
1812 /* Plugin can also disable itself at this stage. */
1813 if (json_scan(tmpctx, buffer, toks, "{result:{disable:%}}",
1814 JSON_SCAN_TAL(tmpctx, json_strdup, &disable)) == NULL) {
1815 /* Don't get upset if this was a built-in! */
1816 plugin->important = false;
1817 plugin_kill(plugin, LOG_DBG,
1818 "disabled itself at init: %s",
1819 disable);
1820 return;
1821 }
1822
1823 plugin->plugin_state = INIT_COMPLETE;
1824 plugin->timeout_timer = tal_free(plugin->timeout_timer);
1825 if (plugin->start_cmd) {
1826 plugin_cmd_succeeded(plugin->start_cmd, plugin);
1827 plugin->start_cmd = NULL;
1828 }
1829 check_plugins_initted(plugin->plugins);
1830}
1831
1832static void json_add_plugin_opt(struct json_stream *stream,
1833 const char *name,

Callers

nothing calls this directly

Calls 5

plugin_killFunction · 0.85
tal_freeFunction · 0.85
plugin_cmd_succeededFunction · 0.85
check_plugins_inittedFunction · 0.85
json_scanFunction · 0.50

Tested by

no test coverage detected