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

Function unknown_field

common/bolt11.c:133–148  ·  view source on GitHub ↗

* These handle specific fields in the payment request; returning the problem * if any, or NULL. */

Source from the content-addressed store, hash-verified

131 * if any, or NULL.
132 */
133static const char *unknown_field(struct bolt11 *b11,
134 struct hash_u5 *hu5,
135 const u5 **data, size_t *field_len,
136 u5 type)
137{
138 struct bolt11_field *extra = tal(b11, struct bolt11_field);
139 const char *err;
140
141 extra->tag = type;
142 /* FIXME: record u8 data here, not u5! */
143 extra->data = tal_dup_arr(extra, u5, *data, *field_len, 0);
144 list_add_tail(&b11->extra_fields, &extra->list);
145
146 tal_free(pull_all(extra, hu5, data, field_len, true, &err));
147 return err;
148}
149
150/* If field isn't expected length (in *bech32*!), call unknown_field.
151 * Otherwise copy into dst without padding, set have_flag if non-NULL. */

Callers 3

pull_expected_lengthFunction · 0.70
decode_fFunction · 0.70
bolt11_decode_nosigFunction · 0.70

Calls 2

tal_freeFunction · 0.85
pull_allFunction · 0.85

Tested by

no test coverage detected