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

Function process_json_result

plugins/sql.c:926–947  ·  view source on GitHub ↗

Process top-level JSON result object. * If update is true, ignore entries > td->last_created_index, and * delete before insert. * Put the maximum processed created_index in *last_created_index. * Put the number of entries in *num_entries, if not NULL; */

Source from the content-addressed store, hash-verified

924 * Put the number of entries in *num_entries, if not NULL;
925 */
926static struct command_result *process_json_result(struct command *cmd,
927 const char *buf,
928 const jsmntok_t *result,
929 const struct table_desc *td,
930 bool update,
931 u64 *last_created_index,
932 u64 *last_updated_index,
933 size_t *num_entries)
934{
935 const jsmntok_t *arr;
936 struct timerel so_far = timemono_since(td->refresh_start);
937 plugin_log(cmd->plugin, LOG_DBG,
938 "Time to call %s%s: %"PRIu64".%09"PRIu64" seconds",
939 td->cmdname, update ? " (updates)" : "",
940 (u64)so_far.ts.tv_sec, (u64)so_far.ts.tv_nsec);
941
942 arr = json_get_member(buf, result, td->arrname);
943 if (num_entries)
944 *num_entries = arr->size;
945 return process_json_list(cmd, buf, arr, NULL, td, update,
946 last_created_index, last_updated_index);
947}
948
949static struct command_result *default_list_done(struct command *cmd,
950 const char *method,

Callers 5

default_list_doneFunction · 0.85
listchannels_one_doneFunction · 0.85
listnodes_one_doneFunction · 0.85
limited_list_doneFunction · 0.85
updated_list_doneFunction · 0.85

Calls 4

timemono_sinceFunction · 0.85
json_get_memberFunction · 0.85
process_json_listFunction · 0.85
plugin_logFunction · 0.70

Tested by

no test coverage detected