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

Function plugin_opts_add

lightningd/plugin.c:1161–1185  ·  view source on GitHub ↗

Iterate through the options in the manifest response, and add them * to the plugin and the command line options */

Source from the content-addressed store, hash-verified

1159/* Iterate through the options in the manifest response, and add them
1160 * to the plugin and the command line options */
1161static const char *plugin_opts_add(struct plugin *plugin,
1162 const char *buffer,
1163 const jsmntok_t *resulttok)
1164{
1165 const jsmntok_t *options = json_get_member(buffer, resulttok, "options");
1166 size_t i;
1167 const jsmntok_t *t;
1168
1169 if (!options) {
1170 return tal_fmt(plugin,
1171 "\"result.options\" was not found in the manifest");
1172 }
1173
1174 if (options->type != JSMN_ARRAY) {
1175 return tal_fmt(plugin, "\"result.options\" is not an array");
1176 }
1177
1178 json_for_each_arr(i, t, options) {
1179 const char *err = plugin_opt_add(plugin, buffer, t);
1180 if (err)
1181 return err;
1182 }
1183
1184 return NULL;
1185}
1186
1187static void json_stream_forward_change_id(struct json_stream *stream,
1188 const char *buffer,

Callers 1

Calls 2

json_get_memberFunction · 0.85
plugin_opt_addFunction · 0.85

Tested by

no test coverage detected