2019-05-31 09:30:32 +02:00
|
|
|
#ifndef LIGHTNING_COMMON_HTLC_TRIM_H
|
|
|
|
#define LIGHTNING_COMMON_HTLC_TRIM_H
|
|
|
|
#include "config.h"
|
|
|
|
#include <common/amount.h>
|
|
|
|
#include <common/htlc.h>
|
|
|
|
|
|
|
|
/* If this htlc too small to create an output on @side's commitment tx? */
|
|
|
|
bool htlc_is_trimmed(enum side htlc_owner,
|
|
|
|
struct amount_msat htlc_amount,
|
|
|
|
u32 feerate_per_kw,
|
|
|
|
struct amount_sat dust_limit,
|
2020-08-13 19:44:02 +02:00
|
|
|
enum side side,
|
|
|
|
bool option_anchor_outputs);
|
2019-05-31 09:30:32 +02:00
|
|
|
|
2021-09-28 21:12:01 +02:00
|
|
|
/* Calculate the our htlc-trimming buffer feerate
|
|
|
|
* (max(25%, 10s/vbyte) above feerate_per_kw) */
|
|
|
|
u32 htlc_trim_feerate_ceiling(u32 feerate_per_kw);
|
2019-05-31 09:30:32 +02:00
|
|
|
#endif /* LIGHTNING_COMMON_HTLC_TRIM_H */
|