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

Function invoice_decode_nosig

common/bolt12.c:258–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258struct 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
288static void add_days(struct tm *tm, u32 number)
289{

Callers 2

invoice_decodeFunction · 0.70
fetch_out_desc_invstrFunction · 0.50

Calls 4

string_to_dataFunction · 0.85
check_features_and_chainFunction · 0.85
tal_freeFunction · 0.85
fromwire_tlv_invoiceFunction · 0.50

Tested by

no test coverage detected