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

Function invoice_request_for_offer

common/bolt12.c:1085–1096  ·  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

1083 * - MUST copy all fields from the offer (including unknown fields).
1084 */
1085struct tlv_invoice_request *invoice_request_for_offer(const tal_t *ctx,
1086 const struct tlv_offer *offer)
1087{
1088 const u8 *cursor;
1089 size_t max;
1090 u8 *wire = tal_arr(tmpctx, u8, 0);
1091 towire_tlv_offer(&wire, offer);
1092
1093 cursor = wire;
1094 max = tal_bytelen(wire);
1095 return fromwire_tlv_invoice_request(ctx, &cursor, &max);
1096}
1097
1098/**
1099 * 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