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

Function json_tok_bin_from_hex

common/json_parse.c:139–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139u8 *json_tok_bin_from_hex(const tal_t *ctx, const char *buffer, const jsmntok_t *tok)
140{
141 u8 *result;
142 size_t hexlen, rawlen;
143 hexlen = tok->end - tok->start;
144 rawlen = hex_data_size(hexlen);
145
146 result = tal_arr(ctx, u8, rawlen);
147 if (!hex_decode(buffer + tok->start, hexlen, result, rawlen))
148 return tal_free(result);
149
150 return result;
151}
152
153/* talfmt take a ctx pointer and return NULL or a valid pointer.
154 * fmt takes the argument, and returns a bool.

Callers 15

param_bin_from_hexFunction · 0.70
param_hops_arrayFunction · 0.70
param_extra_tlvsFunction · 0.70
hook_gives_failmsgFunction · 0.50
process_json_objFunction · 0.50
handle_errorFunction · 0.50
handle_invreq_responseFunction · 0.50
setup_backup_mapFunction · 0.50
listdatastore_doneFunction · 0.50

Calls 3

hex_data_sizeFunction · 0.85
hex_decodeFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected