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

Function decode_x

common/bolt11.c:243–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241 */
242#define DEFAULT_X 3600
243static char *decode_x(struct bolt11 *b11,
244 struct hash_u5 *hu5,
245 u5 **data, size_t *data_len,
246 size_t data_length, bool *have_x)
247{
248 if (*have_x)
249 return unknown_field(b11, hu5, data, data_len, 'x',
250 data_length);
251
252 /* FIXME: Put upper limit in bolt 11 */
253 if (!pull_uint(hu5, data, data_len, &b11->expiry, data_length * 5))
254 return tal_fmt(b11, "x: length %zu chars is excessive",
255 *data_len);
256
257 *have_x = true;
258 return NULL;
259}
260
261/* BOLT #11:
262 *

Callers 1

bolt11_decode_nosigFunction · 0.85

Calls 2

unknown_fieldFunction · 0.85
pull_uintFunction · 0.85

Tested by

no test coverage detected