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

Function onionmsg_tlvs_from_blinded_path

common/onion_message.c:96–110  ·  view source on GitHub ↗

Stage 2: turn struct blinded_path into array of tlv_onionmsg_tlv. * You normally then add fields to the final tlv_onionmsg_tlv. */

Source from the content-addressed store, hash-verified

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. */
96struct 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) */
113struct sphinx_hop **onionmsg_tlvs_to_hops(const tal_t *ctx,

Callers 1

outgoing_onion_messageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected