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

Function mk_failed_htlc

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

Source from the content-addressed store, hash-verified

164}
165
166static struct failed_htlc *mk_failed_htlc(const tal_t *ctx,
167 const struct htlc_in *hin,
168 const struct onionreply *failonion)
169{
170 struct failed_htlc *f = tal(ctx, struct failed_htlc);
171
172 /* Inside a blinded path, override return */
173 if (blind_error_return(hin)) {
174 struct sha256 sha;
175 sha256(&sha, hin->onion_routing_packet,
176 sizeof(hin->onion_routing_packet));
177 failonion = create_onionreply(tmpctx, hin->shared_secret,
178 towire_invalid_onion_blinding(tmpctx, &sha));
179 }
180
181 f->id = hin->key.id;
182 f->sha256_of_onion = NULL;
183 f->badonion = 0;
184 /* Wrap onion error */
185 f->onion = wrap_onionreply(f, hin->shared_secret, failonion);
186
187 return f;
188}
189
190static struct failed_htlc *mk_failed_htlc_badonion(const tal_t *ctx,
191 const struct htlc_in *hin,

Callers 3

mk_failed_htlc_badonionFunction · 0.85
fail_in_htlcFunction · 0.85
peer_htlcsFunction · 0.85

Calls 4

blind_error_returnFunction · 0.85
create_onionreplyFunction · 0.85
wrap_onionreplyFunction · 0.85
sha256Class · 0.70

Tested by

no test coverage detected