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

Function rpc_command_hook_serialize

lightningd/jsonrpc.c:799–815  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

797};
798
799static void rpc_command_hook_serialize(struct rpc_command_hook_payload *p,
800 struct json_stream *s,
801 struct plugin *plugin)
802{
803 const jsmntok_t *tok;
804 size_t i;
805 char *key;
806 json_object_start(s, "rpc_command");
807
808 json_for_each_obj(i, tok, p->request) {
809 key = tal_strndup(NULL, p->buffer + tok->start,
810 tok->end - tok->start);
811 json_add_tok(s, key, tok + 1, p->buffer);
812 tal_free(key);
813 }
814 json_object_end(s);
815}
816
817static void replace_command(struct rpc_command_hook_payload *p,
818 const char *buffer,

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected