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

Function calc_offer

common/bolt12.c:697–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

695}
696
697static void calc_offer(const u8 *tlvstream, struct sha256 *id)
698{
699 size_t start1, len1, start2, len2;
700 struct sha256_ctx ctx;
701
702 /* BOLT #12:
703 * A writer of an offer:
704 * - MUST NOT set any TLV fields outside the inclusive ranges: 1 to 79 and 1000000000 to 1999999999.
705 */
706 len1 = tlv_span(tlvstream, 1, 79, &start1);
707 len2 = tlv_span(tlvstream, 1000000000, 1999999999, &start2);
708
709 sha256_init(&ctx);
710 sha256_update(&ctx, tlvstream + start1, len1);
711 sha256_update(&ctx, tlvstream + start2, len2);
712 sha256_done(&ctx, id);
713}
714
715void offer_offer_id(const struct tlv_offer *offer, struct sha256 *id)
716{

Callers 3

offer_offer_idFunction · 0.85
invreq_offer_idFunction · 0.85
invoice_offer_idFunction · 0.85

Calls 4

tlv_spanFunction · 0.85
sha256_initFunction · 0.85
sha256_updateFunction · 0.85
sha256_doneFunction · 0.85

Tested by

no test coverage detected