| 37 | } |
| 38 | |
| 39 | u8 *onion_nonfinal_hop(const tal_t *ctx, |
| 40 | const struct short_channel_id *scid, |
| 41 | struct amount_msat forward, |
| 42 | u32 outgoing_cltv, |
| 43 | const struct pubkey *blinding, |
| 44 | const u8 *enctlv) |
| 45 | { |
| 46 | struct tlv_tlv_payload *tlv = tlv_tlv_payload_new(tmpctx); |
| 47 | |
| 48 | /* BOLT #4: |
| 49 | * |
| 50 | * The writer: |
| 51 | *... |
| 52 | * - For every node: |
| 53 | * - MUST include `amt_to_forward` and `outgoing_cltv_value`. |
| 54 | * - For every non-final node: |
| 55 | * - MUST include `short_channel_id` |
| 56 | * - MUST NOT include `payment_data` |
| 57 | */ |
| 58 | tlv->amt_to_forward = &forward.millisatoshis; /* Raw: TLV convert */ |
| 59 | tlv->outgoing_cltv_value = &outgoing_cltv; |
| 60 | tlv->short_channel_id = cast_const(struct short_channel_id *, scid); |
| 61 | tlv->blinding_point = cast_const(struct pubkey *, blinding); |
| 62 | tlv->encrypted_recipient_data = cast_const(u8 *, enctlv); |
| 63 | return make_tlv_hop(ctx, tlv); |
| 64 | } |
| 65 | |
| 66 | u8 *onion_final_hop(const tal_t *ctx, |
| 67 | struct amount_msat forward, |
no test coverage detected