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

Function plugin_add_params

lightningd/plugin.c:1366–1392  ·  view source on GitHub ↗

start command might have included plugin-specific parameters */

Source from the content-addressed store, hash-verified

1364
1365/* start command might have included plugin-specific parameters */
1366static const char *plugin_add_params(struct plugin *plugin)
1367{
1368 size_t i;
1369 const jsmntok_t *t;
1370
1371 if (!plugin->params)
1372 return NULL;
1373
1374 json_for_each_obj(i, t, plugin->params) {
1375 struct plugin_opt *popt;
1376 char *err;
1377
1378 popt = plugin_opt_find(plugin,
1379 plugin->parambuf + t->start,
1380 t->end - t->start);
1381 if (!popt) {
1382 return tal_fmt(plugin, "unknown parameter %.*s",
1383 json_tok_full_len(t),
1384 json_tok_full(plugin->parambuf, t));
1385 }
1386 err = plugin_opt_set(json_strdup(tmpctx, plugin->parambuf,
1387 t + 1), popt);
1388 if (err)
1389 return err;
1390 }
1391 return NULL;
1392}
1393
1394static void plugin_manifest_timeout(struct plugin *plugin)
1395{

Callers 1

Calls 5

plugin_opt_findFunction · 0.85
plugin_opt_setFunction · 0.85
json_tok_full_lenFunction · 0.50
json_tok_fullFunction · 0.50
json_strdupFunction · 0.50

Tested by

no test coverage detected