| 1948 | } |
| 1949 | |
| 1950 | static u8 **derive_htlc_scripts(const struct htlc_stub *htlcs, enum side side) |
| 1951 | { |
| 1952 | size_t i; |
| 1953 | u8 **htlc_scripts = tal_arr(htlcs, u8 *, tal_count(htlcs)); |
| 1954 | |
| 1955 | for (i = 0; i < tal_count(htlcs); i++) { |
| 1956 | if (htlcs[i].owner == side) |
| 1957 | htlc_scripts[i] = htlc_offered_wscript(htlc_scripts, |
| 1958 | &htlcs[i].ripemd, |
| 1959 | keyset, |
| 1960 | option_anchor_outputs, |
| 1961 | option_anchors_zero_fee_htlc_tx); |
| 1962 | else { |
| 1963 | /* FIXME: remove abs_locktime */ |
| 1964 | struct abs_locktime ltime; |
| 1965 | if (!blocks_to_abs_locktime(htlcs[i].cltv_expiry, |
| 1966 | <ime)) |
| 1967 | status_failed(STATUS_FAIL_INTERNAL_ERROR, |
| 1968 | "Could not convert cltv_expiry %u to locktime", |
| 1969 | htlcs[i].cltv_expiry); |
| 1970 | htlc_scripts[i] = htlc_received_wscript(htlc_scripts, |
| 1971 | &htlcs[i].ripemd, |
| 1972 | <ime, |
| 1973 | keyset, |
| 1974 | option_anchor_outputs, |
| 1975 | option_anchors_zero_fee_htlc_tx); |
| 1976 | } |
| 1977 | } |
| 1978 | return htlc_scripts; |
| 1979 | } |
| 1980 | |
| 1981 | static size_t resolve_our_htlc_ourcommit(struct tracked_output *out, |
| 1982 | const size_t *matches, |
no test coverage detected