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

Function htlc_success_fee

common/htlc_tx.h:36–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36static inline struct amount_sat htlc_success_fee(u32 feerate_per_kw,
37 bool option_anchor_outputs)
38{
39 /* BOLT #3:
40 *
41 * The fee for an HTLC-success transaction:
42 *...
43 * - Otherwise, MUST be calculated to match:
44 * 1. Multiply `feerate_per_kw` by 703 (706 if `option_anchor_outputs`
45 * applies) and divide by 1000 (rounding down).
46 */
47 u32 base;
48 if (option_anchor_outputs)
49 base = 706;
50 else
51 base = 703;
52 return amount_tx_fee(base + elements_tx_overhead(chainparams, 1, 1),
53 feerate_per_kw);
54}
55
56/* Create HTLC-success tx to spend a received HTLC commitment tx
57 * output; doesn't fill in input witness. */

Callers 3

json_feeratesFunction · 0.85
htlc_is_trimmedFunction · 0.85
htlc_success_txFunction · 0.85

Calls 2

elements_tx_overheadFunction · 0.85
amount_tx_feeFunction · 0.70

Tested by

no test coverage detected