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

Function plugin_rpcmethods_add

lightningd/plugin.c:1412–1436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1410}
1411
1412static const char *plugin_rpcmethods_add(struct plugin *plugin,
1413 const char *buffer,
1414 const jsmntok_t *resulttok)
1415{
1416 const jsmntok_t *methods =
1417 json_get_member(buffer, resulttok, "rpcmethods");
1418
1419 if (!methods)
1420 return tal_fmt(plugin, "\"result.rpcmethods\" missing");
1421
1422 if (methods->type != JSMN_ARRAY) {
1423 return tal_fmt(plugin,
1424 "\"result.rpcmethods\" is not an array");
1425 }
1426
1427 for (size_t i = 0; i < methods->size; i++) {
1428 const char *err;
1429 err = plugin_rpcmethod_add(plugin, buffer,
1430 json_get_arr(methods, i));
1431 if (err)
1432 return err;
1433 }
1434
1435 return NULL;
1436}
1437
1438static const char *plugin_subscriptions_add(struct plugin *plugin,
1439 const char *buffer,

Callers 1

Calls 3

json_get_memberFunction · 0.85
plugin_rpcmethod_addFunction · 0.85
json_get_arrFunction · 0.85

Tested by

no test coverage detected