| 96 | } |
| 97 | |
| 98 | u8 *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 | } |
no test coverage detected