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

Function json_id

plugins/libplugin.c:342–361  ·  view source on GitHub ↗

Prefix is usually a cmd->id */

Source from the content-addressed store, hash-verified

340
341/* Prefix is usually a cmd->id */
342static const char *json_id(const tal_t *ctx, struct plugin *plugin,
343 const char *method, const char *prefix)
344{
345 const char *rawid;
346 int rawidlen;
347
348 /* Strip quotes! */
349 if (strstarts(prefix, "\"")) {
350 assert(strlen(prefix) >= 2);
351 assert(strends(prefix, "\""));
352 rawid = prefix + 1;
353 rawidlen = strlen(prefix) - 2;
354 } else {
355 rawid = prefix;
356 rawidlen = strlen(prefix);
357 }
358
359 return tal_fmt(ctx, "\"%.*s/%s:%s#%"PRIu64"\"",
360 rawidlen, rawid, plugin->id, method, plugin->next_outreq_id++);
361}
362
363static void destroy_out_req(struct out_req *out_req, struct plugin *plugin)
364{

Callers 2

jsonrpc_request_start_Function · 0.85
sync_reqFunction · 0.85

Calls 1

strendsFunction · 0.85

Tested by

no test coverage detected