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

Function plugin_opts_add

lightningd/plugin.c:998–1021  ·  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

996/* Iterate through the options in the manifest response, and add them
997 * to the plugin and the command line options */
998static const char *plugin_opts_add(struct plugin *plugin,
999 const char *buffer,
1000 const jsmntok_t *resulttok)
1001{
1002 const jsmntok_t *options = json_get_member(buffer, resulttok, "options");
1003
1004 if (!options) {
1005 return tal_fmt(plugin,
1006 "\"result.options\" was not found in the manifest");
1007 }
1008
1009 if (options->type != JSMN_ARRAY) {
1010 return tal_fmt(plugin, "\"result.options\" is not an array");
1011 }
1012
1013 for (size_t i = 0; i < options->size; i++) {
1014 const char *err;
1015 err = plugin_opt_add(plugin, buffer, json_get_arr(options, i));
1016 if (err)
1017 return err;
1018 }
1019
1020 return NULL;
1021}
1022
1023static void json_stream_forward_change_id(struct json_stream *stream,
1024 const char *buffer,

Callers 1

Calls 3

plugin_opt_addFunction · 0.85
json_get_arrFunction · 0.85
json_get_memberFunction · 0.50

Tested by

no test coverage detected