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

Function fromwire_existing_htlc

common/htlc_wire.c:193–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193struct existing_htlc *fromwire_existing_htlc(const tal_t *ctx,
194 const u8 **cursor, size_t *max)
195{
196 struct existing_htlc *existing = tal(ctx, struct existing_htlc);
197
198 existing->state = fromwire_u8(cursor, max);
199 existing->id = fromwire_u64(cursor, max);
200 existing->amount = fromwire_amount_msat(cursor, max);
201 fromwire_sha256(cursor, max, &existing->payment_hash);
202 existing->cltv_expiry = fromwire_u32(cursor, max);
203 fromwire(cursor, max, existing->onion_routing_packet,
204 sizeof(existing->onion_routing_packet));
205 if (fromwire_bool(cursor, max)) {
206 existing->payment_preimage = tal(existing, struct preimage);
207 fromwire_preimage(cursor, max, existing->payment_preimage);
208 } else
209 existing->payment_preimage = NULL;
210 if (fromwire_bool(cursor, max))
211 existing->failed = fromwire_failed_htlc(existing, cursor, max);
212 else
213 existing->failed = NULL;
214 if (fromwire_bool(cursor, max)) {
215 existing->blinding = tal(existing, struct pubkey);
216 fromwire_pubkey(cursor, max, existing->blinding);
217 } else
218 existing->blinding = NULL;
219 return existing;
220}
221
222struct simple_htlc *fromwire_simple_htlc(const tal_t *ctx,
223 const u8 **cursor, size_t *max)

Callers

nothing calls this directly

Calls 10

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