core-lightning/common/blindedpay.h
Rusty Russell 511e8e6477 common/blindedpay: routines to construct a blinded payment.
Don't shoehorn it into onion_nonfinal_hop() and onion_final_hop(), but
provide an explicit routine "blinded_onion_hops" and an onion helper
"onion_blinded_hop()" for it to call.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2022-10-26 11:29:06 +10:30

25 lines
757 B
C

/* Code to create onion fragments to make payment down this struct blinded_path */
#ifndef LIGHTNING_COMMON_BLINDEDPAY_H
#define LIGHTNING_COMMON_BLINDEDPAY_H
#include "config.h"
#include <ccan/tal/tal.h>
#include <common/amount.h>
struct blinded_path;
/**
* blinded_onion_hops - turn this path into a series of onion hops
* @ctx: context to allocate from
* @final_amount: amount we want to reach the end
* @final_cltv: cltv we want to at end
* @payinfo: fee and other restriction info
*
* This calls onion_nonfinal_hop and onion_final_hop to create onion
* blobs.
*/
u8 **blinded_onion_hops(const tal_t *ctx,
struct amount_msat final_amount,
u32 final_cltv,
const struct blinded_path *path);
#endif /* LIGHTNING_COMMON_BLINDEDPAY_H */