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

Function bwatch_list_datastore

plugins/bwatch/bwatch_store.c:160–178  ·  view source on GitHub ↗

List all datastore entries under a key prefix (up to 2 components). */

Source from the content-addressed store, hash-verified

158
159/* List all datastore entries under a key prefix (up to 2 components). */
160static const jsmntok_t *bwatch_list_datastore(const tal_t *ctx,
161 struct command *cmd,
162 const char *key1, const char *key2,
163 const char **buf_out)
164{
165 struct json_out *params = json_out_new(tmpctx);
166 const jsmntok_t *result;
167
168 json_out_start(params, NULL, '{');
169 json_out_start(params, "key", '[');
170 json_out_addstr(params, NULL, key1);
171 if (key2)
172 json_out_addstr(params, NULL, key2);
173 json_out_end(params, ']');
174 json_out_end(params, '}');
175
176 result = jsonrpc_request_sync(ctx, cmd, "listdatastore", params, buf_out);
177 return json_get_member(*buf_out, result, "datastore");
178}
179
180/* Datastore write completed (success or expected failure such as duplicate).
181 * Either way, invoke the caller's continuation to keep the poll chain alive. */

Callers 2

load_watches_by_typeFunction · 0.85

Calls 6

json_out_newFunction · 0.85
json_out_startFunction · 0.85
json_out_addstrFunction · 0.85
json_out_endFunction · 0.85
json_get_memberFunction · 0.85
jsonrpc_request_syncFunction · 0.50

Tested by

no test coverage detected