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

Function rpc_command_hook_serialize

lightningd/jsonrpc.c:672–688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

670};
671
672static void rpc_command_hook_serialize(struct rpc_command_hook_payload *p,
673 struct json_stream *s,
674 struct plugin *plugin)
675{
676 const jsmntok_t *tok;
677 size_t i;
678 char *key;
679 json_object_start(s, "rpc_command");
680
681 json_for_each_obj(i, tok, p->request) {
682 key = tal_strndup(NULL, p->buffer + tok->start,
683 tok->end - tok->start);
684 json_add_tok(s, key, tok + 1, p->buffer);
685 tal_free(key);
686 }
687 json_object_end(s);
688}
689
690static void replace_command(struct rpc_command_hook_payload *p,
691 const char *buffer,

Callers

nothing calls this directly

Calls 4

json_add_tokFunction · 0.85
tal_freeFunction · 0.85
json_object_startFunction · 0.50
json_object_endFunction · 0.50

Tested by

no test coverage detected