MCPcopy Create free account
hub / github.com/ElementsProject/lightning / note_missing_htlcs

Function note_missing_htlcs

onchaind/onchaind.c:2217–2243  ·  view source on GitHub ↗

Tell master about any we didn't use, if it wants to know. */

Source from the content-addressed store, hash-verified

2215
2216/* Tell master about any we didn't use, if it wants to know. */
2217static 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
2245static void get_anchor_scriptpubkeys(const tal_t *ctx, u8 **anchor)
2246{

Callers 3

handle_our_unilateralFunction · 0.85
handle_their_cheatFunction · 0.85
handle_their_unilateralFunction · 0.85

Calls 2

wire_sync_writeFunction · 0.50

Tested by

no test coverage detected