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

Function fromwire_existing_htlc

common/htlc_wire.c:242–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

240}
241
242struct existing_htlc *fromwire_existing_htlc(const tal_t *ctx,
243 const u8 **cursor, size_t *max)
244{
245 struct existing_htlc *existing = tal(ctx, struct existing_htlc);
246
247 existing->state = fromwire_u8(cursor, max);
248 existing->id = fromwire_u64(cursor, max);
249 existing->amount = fromwire_amount_msat(cursor, max);
250 fromwire_sha256(cursor, max, &existing->payment_hash);
251 existing->cltv_expiry = fromwire_u32(cursor, max);
252 fromwire(cursor, max, existing->onion_routing_packet,
253 sizeof(existing->onion_routing_packet));
254 if (fromwire_bool(cursor, max)) {
255 existing->payment_preimage = tal(existing, struct preimage);
256 fromwire_preimage(cursor, max, existing->payment_preimage);
257 } else
258 existing->payment_preimage = NULL;
259 if (fromwire_bool(cursor, max))
260 existing->failed = fromwire_failed_htlc(existing, cursor, max);
261 else
262 existing->failed = NULL;
263 if (fromwire_bool(cursor, max)) {
264 existing->path_key = tal(existing, struct pubkey);
265 fromwire_pubkey(cursor, max, existing->path_key);
266 } else
267 existing->path_key = NULL;
268 if (fromwire_bool(cursor, max)) {
269 existing->extra_tlvs = fromwire_len_and_tlvstream(existing, cursor, max);
270 } else
271 existing->extra_tlvs = NULL;
272 return existing;
273}
274
275void fromwire_fulfilled_htlc(const u8 **cursor, size_t *max,
276 struct fulfilled_htlc *fulfilled)

Callers

nothing calls this directly

Calls 11

fromwire_preimageFunction · 0.85
fromwire_failed_htlcFunction · 0.85
fromwire_pubkeyFunction · 0.85
fromwire_amount_msatFunction · 0.70
fromwire_u8Function · 0.50
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