| 2266 | } |
| 2267 | |
| 2268 | static u8 **derive_htlc_scripts(const struct htlc_stub *htlcs, enum side side) |
| 2269 | { |
| 2270 | size_t i; |
| 2271 | u8 **htlc_scripts = tal_arr(htlcs, u8 *, tal_count(htlcs)); |
| 2272 | |
| 2273 | for (i = 0; i < tal_count(htlcs); i++) { |
| 2274 | if (htlcs[i].owner == side) |
| 2275 | htlc_scripts[i] = htlc_offered_wscript(htlc_scripts, |
| 2276 | &htlcs[i].ripemd, |
| 2277 | keyset, |
| 2278 | option_anchor_outputs); |
| 2279 | else { |
| 2280 | /* FIXME: remove abs_locktime */ |
| 2281 | struct abs_locktime ltime; |
| 2282 | if (!blocks_to_abs_locktime(htlcs[i].cltv_expiry, |
| 2283 | <ime)) |
| 2284 | status_failed(STATUS_FAIL_INTERNAL_ERROR, |
| 2285 | "Could not convert cltv_expiry %u to locktime", |
| 2286 | htlcs[i].cltv_expiry); |
| 2287 | htlc_scripts[i] = htlc_received_wscript(htlc_scripts, |
| 2288 | &htlcs[i].ripemd, |
| 2289 | <ime, |
| 2290 | keyset, |
| 2291 | option_anchor_outputs); |
| 2292 | } |
| 2293 | } |
| 2294 | return htlc_scripts; |
| 2295 | } |
| 2296 | |
| 2297 | static size_t resolve_our_htlc_ourcommit(struct tracked_output *out, |
| 2298 | const size_t *matches, |
no test coverage detected