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

Function htlc_set_hin_destroyed

lightningd/htlc_set.c:11–24  ·  view source on GitHub ↗

If an HTLC times out, we need to free entire set, since we could be processing * it in invoice.c right now. */

Source from the content-addressed store, hash-verified

9/* If an HTLC times out, we need to free entire set, since we could be processing
10 * it in invoice.c right now. */
11static void htlc_set_hin_destroyed(struct htlc_in *hin,
12 struct htlc_set *set)
13{
14 for (size_t i = 0; i < tal_count(set->htlcs); i++) {
15 if (set->htlcs[i] == hin) {
16 /* Don't try to re-fail this HTLC! */
17 tal_arr_remove(&set->htlcs, i);
18 /* Kind of the correct failure code. */
19 htlc_set_fail(set, take(towire_mpp_timeout(NULL)));
20 return;
21 }
22 }
23 abort();
24}
25
26static void destroy_htlc_set(struct htlc_set *set,
27 struct htlc_set_map *map)

Callers

nothing calls this directly

Calls 2

abortFunction · 0.85
htlc_set_failFunction · 0.70

Tested by

no test coverage detected