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

Function jsonrpc_set_datastore_

plugins/libplugin.c:673–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

671}
672
673struct command_result *jsonrpc_set_datastore_(struct plugin *plugin,
674 struct command *cmd,
675 const char *path,
676 const void *value,
677 bool value_is_string,
678 const char *mode,
679 struct command_result *(*cb)(struct command *command,
680 const char *buf,
681 const jsmntok_t *result,
682 void *arg),
683 struct command_result *(*errcb)(struct command *command,
684 const char *buf,
685 const jsmntok_t *result,
686 void *arg),
687 void *arg)
688{
689 struct out_req *req;
690
691 if (!cb)
692 cb = ignore_cb;
693 if (!errcb)
694 errcb = datastore_fail;
695
696 req = jsonrpc_request_start(plugin, cmd, "datastore", cb, errcb, arg);
697
698 json_add_keypath(req->js->jout, "key", path);
699 if (value_is_string)
700 json_add_string(req->js, "string", value);
701 else
702 json_add_hex_talarr(req->js, "hex", value);
703 json_add_string(req->js, "mode", mode);
704 return send_outreq(plugin, req);
705}
706
707static void handle_rpc_reply(struct plugin *plugin, const jsmntok_t *toks)
708{

Callers

nothing calls this directly

Calls 4

json_add_keypathFunction · 0.85
send_outreqFunction · 0.70
json_add_stringFunction · 0.50
json_add_hex_talarrFunction · 0.50

Tested by

no test coverage detected