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

Function htlc_timeout_fee

common/htlc_tx.h:16–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14struct ripemd160;
15
16static inline struct amount_sat htlc_timeout_fee(u32 feerate_per_kw,
17 bool option_anchor_outputs)
18{
19 /* BOLT #3:
20 *
21 * The fee for an HTLC-timeout transaction:
22 *...
23 * - Otherwise, MUST be calculated to match:
24 * 1. Multiply `feerate_per_kw` by 663 (666 if `option_anchor_outputs`
25 * applies) and divide by 1000 (rounding down).
26 */
27 u32 base;
28 if (option_anchor_outputs)
29 base = 666;
30 else
31 base = 663;
32 return amount_tx_fee(base + elements_tx_overhead(chainparams, 1, 1),
33 feerate_per_kw);
34}
35
36static inline struct amount_sat htlc_success_fee(u32 feerate_per_kw,
37 bool option_anchor_outputs)

Callers 3

json_feeratesFunction · 0.85
htlc_is_trimmedFunction · 0.85
htlc_timeout_txFunction · 0.85

Calls 2

elements_tx_overheadFunction · 0.85
amount_tx_feeFunction · 0.70

Tested by

no test coverage detected