List all datastore entries under a key prefix (up to 2 components). */
| 158 | |
| 159 | /* List all datastore entries under a key prefix (up to 2 components). */ |
| 160 | static 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. */ |
no test coverage detected