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

Function jsonrpc_set_datastore_

plugins/libplugin.c:935–968  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

933}
934
935struct command_result *jsonrpc_set_datastore_(struct command *cmd,
936 const char **keys,
937 const void *value,
938 int len_or_str,
939 const char *mode,
940 struct command_result *(*cb)(struct command *command,
941 const char *method,
942 const char *buf,
943 const jsmntok_t *result,
944 void *arg),
945 struct command_result *(*errcb)(struct command *command,
946 const char *method,
947 const char *buf,
948 const jsmntok_t *result,
949 void *arg),
950 void *arg)
951{
952 struct out_req *req;
953
954 if (!cb)
955 cb = ignore_and_complete;
956 if (!errcb)
957 errcb = plugin_broken_cb;
958
959 req = jsonrpc_request_start(cmd, "datastore", cb, errcb, arg);
960
961 json_add_keypath(req->js->jout, "key", keys);
962 if (len_or_str == -1)
963 json_add_string(req->js, "string", value);
964 else
965 json_add_hex(req->js, "hex", value, len_or_str);
966 json_add_string(req->js, "mode", mode);
967 return send_outreq(req);
968}
969
970struct get_ds_info {
971 struct command_result *(*string_cb)(struct command *command,

Callers

nothing calls this directly

Calls 4

json_add_keypathFunction · 0.85
json_add_hexFunction · 0.85
send_outreqFunction · 0.70
json_add_stringFunction · 0.50

Tested by

no test coverage detected