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

Function mk_failed_htlc_badonion

lightningd/peer_htlcs.c:190–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190static struct failed_htlc *mk_failed_htlc_badonion(const tal_t *ctx,
191 const struct htlc_in *hin,
192 enum onion_wire badonion)
193{
194 struct failed_htlc *f = tal(ctx, struct failed_htlc);
195
196 /* Inside a blinded path, override return */
197 if (blind_error_return(hin))
198 return mk_failed_htlc(ctx, hin, NULL);
199
200 f->id = hin->key.id;
201 f->onion = NULL;
202 f->badonion = badonion;
203 f->sha256_of_onion = tal(f, struct sha256);
204 sha256(f->sha256_of_onion, hin->onion_routing_packet,
205 sizeof(hin->onion_routing_packet));
206 return f;
207}
208
209static void tell_channeld_htlc_failed(const struct htlc_in *hin,
210 const struct failed_htlc *failed_htlc)

Callers 2

peer_htlcsFunction · 0.85

Calls 3

blind_error_returnFunction · 0.85
mk_failed_htlcFunction · 0.85
sha256Class · 0.70

Tested by

no test coverage detected