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

Function payer_proof_decode

common/bolt12_proof.c:471–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469}
470
471struct tlv_payer_proof *payer_proof_decode(const tal_t *ctx,
472 const char *b12, size_t b12len,
473 const char **fail)
474{
475 struct tlv_payer_proof *tlvpp;
476 const u8 *data;
477 size_t dlen;
478
479 data = b12_string_to_data(tmpctx, b12, b12len, "lnp", &dlen, fail);
480 if (!data) {
481 tal_steal(ctx, *fail);
482 return NULL;
483 }
484
485 tlvpp = fromwire_tlv_payer_proof(ctx, &data, &dlen);
486 if (!tlvpp) {
487 *fail = tal_fmt(ctx, "invalid payer_proof data");
488 return NULL;
489 }
490
491 *fail = check_payer_proof(ctx, tlvpp);
492 if (*fail)
493 return tal_free(tlvpp);
494
495 return tlvpp;
496}

Callers 3

generate_valid_vectorFunction · 0.85
param_decodableFunction · 0.85
mainFunction · 0.85

Calls 3

b12_string_to_dataFunction · 0.85
check_payer_proofFunction · 0.85
tal_freeFunction · 0.85

Tested by 1

generate_valid_vectorFunction · 0.68