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

Function jsonarr_accumulate_u64

plugins/keysend.c:115–131  ·  view source on GitHub ↗

values_int is a JSON array of u64s */

Source from the content-addressed store, hash-verified

113
114/* values_int is a JSON array of u64s */
115static bool jsonarr_accumulate_u64(const char *buffer,
116 const jsmntok_t *tok,
117 u64 **dest)
118{
119 const jsmntok_t *t;
120 size_t i, n;
121
122 if (tok->type != JSMN_ARRAY)
123 return false;
124 n = tal_count(*dest);
125 tal_resize(dest, n + tok->size);
126 json_for_each_arr(i, t, tok) {
127 if (!json_to_u64(buffer, t, &(*dest)[n + i]))
128 return false;
129 }
130 return true;
131}
132
133static const char *init(struct command *init_cmd, const char *buf UNUSED,
134 const jsmntok_t *config UNUSED)

Callers

nothing calls this directly

Calls 1

json_to_u64Function · 0.50

Tested by

no test coverage detected