| 1258 | } |
| 1259 | |
| 1260 | static bool encode_extra(u5 **data, const struct bolt11_field *extra) |
| 1261 | { |
| 1262 | /* Can't encode an invalid tag. */ |
| 1263 | if (bech32_charset_rev[(unsigned char)extra->tag] == -1) |
| 1264 | return false; |
| 1265 | |
| 1266 | push_varlen_uint(data, bech32_charset_rev[(unsigned char)extra->tag], 5); |
| 1267 | push_varlen_uint(data, tal_count(extra->data), 10); |
| 1268 | |
| 1269 | /* extra->data is already u5s, so do this raw. */ |
| 1270 | tal_arr_append(data, extra->data); |
| 1271 | return true; |
| 1272 | } |
| 1273 | |
| 1274 | /* Encodes, even if it's nonsense. */ |
| 1275 | char *bolt11_encode_(const tal_t *ctx, |
no test coverage detected