| 127 | } |
| 128 | |
| 129 | struct bitcoin_tx *htlc_timeout_tx(const tal_t *ctx, |
| 130 | const struct chainparams *chainparams, |
| 131 | const struct bitcoin_outpoint *commit, |
| 132 | const u8 *commit_wscript, |
| 133 | struct amount_msat htlc_msatoshi, |
| 134 | u32 cltv_expiry, |
| 135 | u16 to_self_delay, |
| 136 | u32 feerate_per_kw, |
| 137 | const struct keyset *keyset, |
| 138 | bool option_anchor_outputs) |
| 139 | { |
| 140 | /* BOLT #3: |
| 141 | * * locktime: `0` for HTLC-success, `cltv_expiry` for HTLC-timeout |
| 142 | */ |
| 143 | return htlc_tx(ctx, chainparams, commit, |
| 144 | commit_wscript, htlc_msatoshi, to_self_delay, |
| 145 | &keyset->self_revocation_key, |
| 146 | &keyset->self_delayed_payment_key, |
| 147 | htlc_timeout_fee(feerate_per_kw, |
| 148 | option_anchor_outputs), |
| 149 | cltv_expiry, |
| 150 | option_anchor_outputs); |
| 151 | } |
| 152 | |
| 153 | /* Fill in the witness for HTLC-timeout tx produced above. */ |
| 154 | void htlc_timeout_tx_add_witness(struct bitcoin_tx *htlc_timeout, |