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

Function invoice_request_for_offer

common/bolt12.c:782–793  ·  view source on GitHub ↗

BOLT #12: * ## Requirements for Invoice Requests * * The writer: * - if it is responding to an offer: * - MUST copy all fields from the offer (including unknown fields). */

Source from the content-addressed store, hash-verified

780 * - MUST copy all fields from the offer (including unknown fields).
781 */
782struct tlv_invoice_request *invoice_request_for_offer(const tal_t *ctx,
783 const struct tlv_offer *offer)
784{
785 const u8 *cursor;
786 size_t max;
787 u8 *wire = tal_arr(tmpctx, u8, 0);
788 towire_tlv_offer(&wire, offer);
789
790 cursor = wire;
791 max = tal_bytelen(wire);
792 return fromwire_tlv_invoice_request(ctx, &cursor, &max);
793}
794
795/**
796 * Prepare a new invoice based on an invoice_request.

Callers 2

json_fetchinvoiceFunction · 0.85

Calls 3

tal_bytelenFunction · 0.85
towire_tlv_offerFunction · 0.50

Tested by

no test coverage detected