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