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

Function htlc_set_fulfill

lightningd/htlc_set.c:90–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90void htlc_set_fulfill(struct htlc_set *set, const struct preimage *preimage)
91{
92 /* BOLT #4:
93 * - if it fulfills any HTLCs in the HTLC set:
94 * - MUST fulfill the entire HTLC set.
95 */
96 for (size_t i = 0; i < tal_count(set->inpays); i++) {
97 /* Don't remove from set */
98 tal_del_destructor2(set->inpays[i],
99 htlc_set_inpay_destroyed, set);
100
101 /* Reparent set->inpays[i] so it's freed with set */
102 tal_steal(set->inpays, set->inpays[i]);
103 set->inpays[i]->succeeded(set->inpays[i]->arg, preimage);
104 }
105 tal_free(set);
106}
107
108static struct htlc_set *new_htlc_set(struct lightningd *ld,
109 struct incoming_payment *inpay,

Callers 1

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected