| 257 | */ |
| 258 | #define DEFAULT_X 3600 |
| 259 | static const char *decode_x(struct bolt11 *b11, |
| 260 | const struct feature_set *our_features, |
| 261 | struct hash_u5 *hu5, |
| 262 | const u5 **data, size_t *field_len, |
| 263 | bool *have_x) |
| 264 | { |
| 265 | const char *err; |
| 266 | |
| 267 | assert(!*have_x); |
| 268 | |
| 269 | /* BOLT #11: |
| 270 | * - if a `c`, `x`, or `9` field is provided which has a non-minimal `data_length` |
| 271 | * (i.e. begins with 0 field elements): |
| 272 | * - SHOULD treat the invoice as invalid. |
| 273 | */ |
| 274 | err = pull_uint(hu5, data, field_len, &b11->expiry, *field_len * 5, true); |
| 275 | if (err) |
| 276 | return tal_fmt(b11, "x: %s", err); |
| 277 | |
| 278 | *have_x = true; |
| 279 | return NULL; |
| 280 | } |
| 281 | |
| 282 | /* BOLT #11: |
| 283 | * |
nothing calls this directly
no test coverage detected