| 282 | } |
| 283 | |
| 284 | static void sphinx_append_final_hop(const tal_t *ctx, |
| 285 | struct sphinx_path *sp, |
| 286 | const struct secret *payment_secret, |
| 287 | const struct node_id *node, |
| 288 | const struct amount_msat deliver, |
| 289 | const struct amount_msat total, |
| 290 | const u32 final_cltv, |
| 291 | const u8 *payment_metadata) |
| 292 | { |
| 293 | struct pubkey destination; |
| 294 | bool ret = pubkey_from_node_id(&destination, node); |
| 295 | assert(ret); |
| 296 | |
| 297 | const u8 *payload = onion_final_hop(ctx, deliver, final_cltv, total, |
| 298 | payment_secret, payment_metadata); |
| 299 | // FIXME: better handle error here |
| 300 | ret = sphinx_add_hop_has_length(sp, &destination, take(payload)); |
| 301 | assert(ret); |
| 302 | } |
| 303 | |
| 304 | static const u8 *create_onion( |
| 305 | const tal_t *ctx, const unsigned int blockheight, |
no test coverage detected