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). */
| 780 | * - MUST copy all fields from the offer (including unknown fields). |
| 781 | */ |
| 782 | struct 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. |
no test coverage detected