Stage 2: turn struct blinded_path into array of tlv_onionmsg_tlv. * You normally then add fields to the final tlv_onionmsg_tlv. */
| 94 | /* Stage 2: turn struct blinded_path into array of tlv_onionmsg_tlv. |
| 95 | * You normally then add fields to the final tlv_onionmsg_tlv. */ |
| 96 | struct tlv_onionmsg_tlv **onionmsg_tlvs_from_blinded_path(const tal_t *ctx, |
| 97 | const struct blinded_path *bpath) |
| 98 | { |
| 99 | size_t nhops = tal_count(bpath->path); |
| 100 | struct tlv_onionmsg_tlv **otlvs = tal_arr(ctx, struct tlv_onionmsg_tlv *, nhops); |
| 101 | |
| 102 | for (size_t i = 0; i < nhops; i++) { |
| 103 | otlvs[i] = tlv_onionmsg_tlv_new(otlvs); |
| 104 | otlvs[i]->encrypted_recipient_data |
| 105 | = tal_dup_talarr(otlvs[i], u8, |
| 106 | bpath->path[i]->encrypted_recipient_data); |
| 107 | } |
| 108 | |
| 109 | return otlvs; |
| 110 | } |
| 111 | |
| 112 | /* Stage 3: linearize each struct tlv_onionmsg_tlv into sphinx_hops (taking ids from bpath) */ |
| 113 | struct sphinx_hop **onionmsg_tlvs_to_hops(const tal_t *ctx, |
no outgoing calls
no test coverage detected