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

Function invoice_decode

common/bolt12.c:402–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

400}
401
402struct tlv_invoice *invoice_decode(const tal_t *ctx,
403 const char *b12, size_t b12len,
404 const struct feature_set *our_features,
405 const struct chainparams *must_be_chain,
406 char **fail)
407{
408 struct tlv_invoice *invoice;
409
410 invoice = invoice_decode_nosig(ctx, b12, b12len, our_features,
411 must_be_chain, fail);
412 if (invoice) {
413 *fail = check_signature(ctx, invoice->fields,
414 "invoice", "signature",
415 invoice->node_id, invoice->signature);
416 if (*fail)
417 invoice = tal_free(invoice);
418 }
419 return invoice;
420}
421
422static bool bolt12_has_invoice_prefix(const char *str)
423{

Callers 7

prev_invoice_doneFunction · 0.50
json_payFunction · 0.50
createinvoice_doneFunction · 0.50
listsendpays_doneFunction · 0.50
param_decodableFunction · 0.50
mainFunction · 0.50

Calls 3

check_signatureFunction · 0.85
tal_freeFunction · 0.85
invoice_decode_nosigFunction · 0.70

Tested by

no test coverage detected