core-lightning/common/blindedpay.h
Rusty Russell e9eb5f493b common: update to latest route-blinding spec.
```
make check-source-bolt CHECK_BOLT_PREFIX="--prefix=BOLT-route-blinding" BOLTVERSION=guilt/offers
```

Other than textual changes, this does:

1. Ensures we put total_amount_msat in onion final hop (reported by @t-bast).
2. Require that they put total_amount_msat in onion final hop.
3. Return `invalid_onion_blinding` exactly as defined by the spec (i.e. less
   aggressive when we're the final hop) (also reported by @t-bast, but I already
   knew).

See: #5823
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: `offers` breaking blinded payments change (total_amount_sat required, Eclair compat)
2023-01-30 13:24:29 +10:30

28 lines
841 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
* @total_amount: amount of all parts together.
* @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,
struct amount_msat total_amount,
const struct blinded_path *path);
#endif /* LIGHTNING_COMMON_BLINDEDPAY_H */