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

Function fromwire_added_htlc

common/htlc_wire.c:219–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219struct added_htlc *fromwire_added_htlc(const tal_t *ctx, const u8 **cursor,
220 size_t *max)
221{
222 struct added_htlc *added = tal(ctx, struct added_htlc);
223 added->id = fromwire_u64(cursor, max);
224 added->amount = fromwire_amount_msat(cursor, max);
225 fromwire_sha256(cursor, max, &added->payment_hash);
226 added->cltv_expiry = fromwire_u32(cursor, max);
227 fromwire(cursor, max, added->onion_routing_packet,
228 sizeof(added->onion_routing_packet));
229 if (fromwire_bool(cursor, max)) {
230 added->path_key = tal(added, struct pubkey);
231 fromwire_pubkey(cursor, max, added->path_key);
232 } else
233 added->path_key = NULL;
234 if (fromwire_bool(cursor, max)) {
235 added->extra_tlvs = fromwire_len_and_tlvstream(added, cursor, max);
236 } else
237 added->extra_tlvs = NULL;
238 added->fail_immediate = fromwire_bool(cursor, max);
239 return added;
240}
241
242struct existing_htlc *fromwire_existing_htlc(const tal_t *ctx,
243 const u8 **cursor, size_t *max)

Callers

nothing calls this directly

Calls 8

fromwire_pubkeyFunction · 0.85
fromwire_amount_msatFunction · 0.70
fromwire_u64Function · 0.50
fromwire_sha256Function · 0.50
fromwire_u32Function · 0.50
fromwireFunction · 0.50
fromwire_boolFunction · 0.50

Tested by

no test coverage detected