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

Function plugin_rpcmethods_add

lightningd/plugin.c:1244–1268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1242}
1243
1244static const char *plugin_rpcmethods_add(struct plugin *plugin,
1245 const char *buffer,
1246 const jsmntok_t *resulttok)
1247{
1248 const jsmntok_t *methods =
1249 json_get_member(buffer, resulttok, "rpcmethods");
1250
1251 if (!methods)
1252 return tal_fmt(plugin, "\"result.rpcmethods\" missing");
1253
1254 if (methods->type != JSMN_ARRAY) {
1255 return tal_fmt(plugin,
1256 "\"result.rpcmethods\" is not an array");
1257 }
1258
1259 for (size_t i = 0; i < methods->size; i++) {
1260 const char *err;
1261 err = plugin_rpcmethod_add(plugin, buffer,
1262 json_get_arr(methods, i));
1263 if (err)
1264 return err;
1265 }
1266
1267 return NULL;
1268}
1269
1270static const char *plugin_subscriptions_add(struct plugin *plugin,
1271 const char *buffer,

Callers 1

Calls 3

plugin_rpcmethod_addFunction · 0.85
json_get_arrFunction · 0.85
json_get_memberFunction · 0.50

Tested by

no test coverage detected