| 54 | }; |
| 55 | |
| 56 | struct sphinx_path *sphinx_path_new(const tal_t *ctx, |
| 57 | const u8 *associated_data, |
| 58 | size_t associated_data_len) |
| 59 | { |
| 60 | struct sphinx_path *sp = tal(ctx, struct sphinx_path); |
| 61 | if (associated_data) { |
| 62 | sp->associated_data |
| 63 | = tal_dup_arr(sp, u8, associated_data, associated_data_len, 0); |
| 64 | } else { |
| 65 | assert(associated_data_len == 0); |
| 66 | sp->associated_data = NULL; |
| 67 | } |
| 68 | sp->session_key = NULL; |
| 69 | sp->rendezvous_id = NULL; |
| 70 | sp->hops = tal_arr(sp, struct sphinx_hop, 0); |
| 71 | return sp; |
| 72 | } |
| 73 | |
| 74 | struct sphinx_path *sphinx_path_new_with_key(const tal_t *ctx, |
| 75 | const u8 *associated_data, |
no outgoing calls