| 14 | struct ripemd160; |
| 15 | |
| 16 | static 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 | |
| 36 | static inline struct amount_sat htlc_success_fee(u32 feerate_per_kw, |
| 37 | bool option_anchor_outputs) |
no test coverage detected