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

Function jsonrpc_set_datastore_

plugins/libplugin.c:925–958  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

923}
924
925struct command_result *jsonrpc_set_datastore_(struct command *cmd,
926 const char **keys,
927 const void *value,
928 int len_or_str,
929 const char *mode,
930 struct command_result *(*cb)(struct command *command,
931 const char *method,
932 const char *buf,
933 const jsmntok_t *result,
934 void *arg),
935 struct command_result *(*errcb)(struct command *command,
936 const char *method,
937 const char *buf,
938 const jsmntok_t *result,
939 void *arg),
940 void *arg)
941{
942 struct out_req *req;
943
944 if (!cb)
945 cb = ignore_and_complete;
946 if (!errcb)
947 errcb = plugin_broken_cb;
948
949 req = jsonrpc_request_start(cmd, "datastore", cb, errcb, arg);
950
951 json_add_keypath(req->js->jout, "key", keys);
952 if (len_or_str == -1)
953 json_add_string(req->js, "string", value);
954 else
955 json_add_hex(req->js, "hex", value, len_or_str);
956 json_add_string(req->js, "mode", mode);
957 return send_outreq(req);
958}
959
960struct get_ds_info {
961 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