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

Function local_fail_in_htlc_badonion

lightningd/peer_htlcs.c:174–188  ·  view source on GitHub ↗

Immediately fail HTLC with a BADONION code */

Source from the content-addressed store, hash-verified

172
173/* Immediately fail HTLC with a BADONION code */
174static void local_fail_in_htlc_badonion(struct htlc_in *hin,
175 enum onion_wire badonion)
176{
177 struct failed_htlc *failed_htlc;
178 assert(!hin->preimage);
179
180 assert(badonion & BADONION);
181 hin->badonion = badonion;
182 /* We update state now to signal it's in progress, for persistence. */
183 htlc_in_update_state(hin->key.channel, hin, SENT_REMOVE_HTLC);
184 htlc_in_check(hin, __func__);
185
186 failed_htlc = mk_failed_htlc_badonion(tmpctx, hin, badonion);
187 tell_channeld_htlc_failed(hin, failed_htlc);
188}
189
190/* This is used for cases where we can immediately fail the HTLC. */
191void local_fail_in_htlc(struct htlc_in *hin, const u8 *failmsg TAKES)

Callers 2

peer_got_revokeFunction · 0.85
htlcs_resubmitFunction · 0.85

Calls 4

htlc_in_update_stateFunction · 0.85
htlc_in_checkFunction · 0.85
mk_failed_htlc_badonionFunction · 0.85

Tested by

no test coverage detected