Tell master about any we didn't use, if it wants to know. */
| 2215 | |
| 2216 | /* Tell master about any we didn't use, if it wants to know. */ |
| 2217 | static void note_missing_htlcs(u8 **htlc_scripts, |
| 2218 | const struct htlcs_info *htlcs_info) |
| 2219 | { |
| 2220 | /* BOLT #5: |
| 2221 | * - for any committed HTLC that does NOT have an output in this |
| 2222 | * commitment transaction: |
| 2223 | */ |
| 2224 | /* See onchain_control.c for the rest of the quote! */ |
| 2225 | for (size_t i = 0; i < tal_count(htlcs_info->htlcs); i++) { |
| 2226 | u8 *msg; |
| 2227 | |
| 2228 | /* Used. */ |
| 2229 | if (!htlc_scripts[i]) |
| 2230 | continue; |
| 2231 | |
| 2232 | /* Doesn't care. */ |
| 2233 | if (!htlcs_info->tell_if_missing[i]) |
| 2234 | continue; |
| 2235 | |
| 2236 | msg = towire_onchaind_missing_htlc_output(missing_htlc_msgs, |
| 2237 | &htlcs_info->htlcs[i]); |
| 2238 | if (htlcs_info->tell_immediately[i]) |
| 2239 | wire_sync_write(REQ_FD, take(msg)); |
| 2240 | else |
| 2241 | tal_arr_expand(&missing_htlc_msgs, msg); |
| 2242 | } |
| 2243 | } |
| 2244 | |
| 2245 | static void get_anchor_scriptpubkeys(const tal_t *ctx, u8 **anchor) |
| 2246 | { |
no test coverage detected