| 34 | } |
| 35 | |
| 36 | static 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. */ |
no test coverage detected