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

Function sphinx_append_final_hop

plugins/renepay/routetracker.c:284–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284static 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
304static const u8 *create_onion(
305 const tal_t *ctx, const unsigned int blockheight,

Callers 1

create_onionFunction · 0.85

Calls 3

onion_final_hopFunction · 0.85
pubkey_from_node_idFunction · 0.50

Tested by

no test coverage detected