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

Function plugin_rpcmethods_add

lightningd/plugin.c:1400–1424  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1398}
1399
1400static const char *plugin_rpcmethods_add(struct plugin *plugin,
1401 const char *buffer,
1402 const jsmntok_t *resulttok)
1403{
1404 const jsmntok_t *methods =
1405 json_get_member(buffer, resulttok, "rpcmethods");
1406
1407 if (!methods)
1408 return tal_fmt(plugin, "\"result.rpcmethods\" missing");
1409
1410 if (methods->type != JSMN_ARRAY) {
1411 return tal_fmt(plugin,
1412 "\"result.rpcmethods\" is not an array");
1413 }
1414
1415 for (size_t i = 0; i < methods->size; i++) {
1416 const char *err;
1417 err = plugin_rpcmethod_add(plugin, buffer,
1418 json_get_arr(methods, i));
1419 if (err)
1420 return err;
1421 }
1422
1423 return NULL;
1424}
1425
1426static const char *plugin_subscriptions_add(struct plugin *plugin,
1427 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