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

Function fromwire_failed_htlc

common/htlc_wire.c:241–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241struct failed_htlc *fromwire_failed_htlc(const tal_t *ctx, const u8 **cursor, size_t *max)
242{
243 struct failed_htlc *failed = tal(ctx, struct failed_htlc);
244 enum onion_wire badonion;
245
246 failed->id = fromwire_u64(cursor, max);
247 badonion = fromwire_u16(cursor, max);
248 if (badonion) {
249 failed->onion = NULL;
250 if (!(badonion & BADONION))
251 return tal_free(failed);
252 failed->badonion = badonion;
253 failed->sha256_of_onion = tal(failed, struct sha256);
254 fromwire_sha256(cursor, max, failed->sha256_of_onion);
255 } else {
256 failed->sha256_of_onion = NULL;
257 failed->onion = fromwire_onionreply(failed, cursor, max);
258 }
259
260 return failed;
261}
262
263static enum htlc_state fromwire_htlc_state(const u8 **cursor, size_t *max)
264{

Callers 1

fromwire_existing_htlcFunction · 0.85

Calls 5

tal_freeFunction · 0.85
fromwire_onionreplyFunction · 0.85
fromwire_u64Function · 0.50
fromwire_u16Function · 0.50
fromwire_sha256Function · 0.50

Tested by

no test coverage detected