| 2058 | } |
| 2059 | |
| 2060 | static 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 | |
| 2094 | static void json_add_plugin_val(struct json_stream *stream, |
| 2095 | const struct opt_table *ot, |
nothing calls this directly
no test coverage detected