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

Function fromwire_failed_htlc

common/htlc_wire.c:282–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282struct failed_htlc *fromwire_failed_htlc(const tal_t *ctx, const u8 **cursor, size_t *max)
283{
284 struct failed_htlc *failed = tal(ctx, struct failed_htlc);
285 enum onion_wire badonion;
286
287 failed->id = fromwire_u64(cursor, max);
288 badonion = fromwire_u16(cursor, max);
289 if (badonion) {
290 failed->onion = NULL;
291 if (!(badonion & BADONION))
292 return tal_free(failed);
293 failed->badonion = badonion;
294 failed->sha256_of_onion = tal(failed, struct sha256);
295 fromwire_sha256(cursor, max, failed->sha256_of_onion);
296 } else {
297 failed->sha256_of_onion = NULL;
298 failed->onion = fromwire_onionreply(failed, cursor, max);
299 }
300
301 return failed;
302}
303
304static enum htlc_state fromwire_htlc_state(const u8 **cursor, size_t *max)
305{

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