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

Function rpc_command_hook_serialize

lightningd/jsonrpc.c:803–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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