| 256 | } |
| 257 | |
| 258 | struct tlv_invoice *invoice_decode_nosig(const tal_t *ctx, |
| 259 | const char *b12, size_t b12len, |
| 260 | const struct feature_set *our_features, |
| 261 | const struct chainparams *must_be_chain, |
| 262 | char **fail) |
| 263 | { |
| 264 | struct tlv_invoice *invoice; |
| 265 | const u8 *data; |
| 266 | size_t dlen; |
| 267 | |
| 268 | data = string_to_data(tmpctx, b12, b12len, "lni", &dlen, fail); |
| 269 | if (!data) |
| 270 | return NULL; |
| 271 | |
| 272 | invoice = fromwire_tlv_invoice(ctx, &data, &dlen); |
| 273 | if (!invoice) { |
| 274 | *fail = tal_fmt(ctx, "invalid invoice data"); |
| 275 | return NULL; |
| 276 | } |
| 277 | |
| 278 | *fail = check_features_and_chain(ctx, |
| 279 | our_features, must_be_chain, |
| 280 | invoice->features, |
| 281 | invoice->chain, 1); |
| 282 | if (*fail) |
| 283 | return tal_free(invoice); |
| 284 | |
| 285 | return invoice; |
| 286 | } |
| 287 | |
| 288 | static void add_days(struct tm *tm, u32 number) |
| 289 | { |
no test coverage detected