* These handle specific fields in the payment request; returning the problem * if any, or NULL. */
| 131 | * if any, or NULL. |
| 132 | */ |
| 133 | static 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. */ |
no test coverage detected