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

Function onion_blinded_hop

common/onion_encode.c:98–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98u8 *onion_blinded_hop(const tal_t *ctx,
99 const struct amount_msat *amt_to_forward,
100 const struct amount_msat *total_amount_msat,
101 const u32 *outgoing_cltv_value,
102 const u8 *enctlv,
103 const struct pubkey *blinding)
104{
105 struct tlv_payload *tlv = tlv_payload_new(tmpctx);
106
107 if (amt_to_forward) {
108 tlv->amt_to_forward
109 = cast_const(u64 *,
110 &amt_to_forward->millisatoshis); /* Raw: TLV convert */
111 }
112 if (total_amount_msat) {
113 tlv->total_amount_msat
114 = cast_const(u64 *,
115 &total_amount_msat->millisatoshis); /* Raw: TLV convert */
116 }
117 tlv->outgoing_cltv_value = cast_const(u32 *, outgoing_cltv_value);
118 tlv->encrypted_recipient_data = cast_const(u8 *, enctlv);
119 tlv->current_path_key = cast_const(struct pubkey *, blinding);
120
121 return make_tlv_hop(ctx, tlv);
122}

Callers 3

blinded_onion_hopsFunction · 0.85
append_blinded_payloadsFunction · 0.85

Calls 1

make_tlv_hopFunction · 0.85

Tested by

no test coverage detected