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

Function towire_existing_htlc

common/htlc_wire.c:91–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void towire_existing_htlc(u8 **pptr, const struct existing_htlc *existing)
92{
93 towire_u8(pptr, existing->state);
94 towire_u64(pptr, existing->id);
95 towire_amount_msat(pptr, existing->amount);
96 towire_sha256(pptr, &existing->payment_hash);
97 towire_u32(pptr, existing->cltv_expiry);
98 towire(pptr, existing->onion_routing_packet,
99 sizeof(existing->onion_routing_packet));
100 if (existing->payment_preimage) {
101 towire_bool(pptr, true);
102 towire_preimage(pptr, existing->payment_preimage);
103 } else
104 towire_bool(pptr, false);
105 if (existing->failed) {
106 towire_bool(pptr, true);
107 towire_failed_htlc(pptr, existing->failed);
108 } else
109 towire_bool(pptr, false);
110 if (existing->blinding) {
111 towire_bool(pptr, true);
112 towire_pubkey(pptr, existing->blinding);
113 } else
114 towire_bool(pptr, false);
115}
116
117void towire_simple_htlc(u8 **pptr, const struct simple_htlc *simple)
118{

Callers

nothing calls this directly

Calls 10

towire_preimageFunction · 0.85
towire_failed_htlcFunction · 0.85
towire_pubkeyFunction · 0.85
towire_amount_msatFunction · 0.70
towire_u8Function · 0.50
towire_u64Function · 0.50
towire_sha256Function · 0.50
towire_u32Function · 0.50
towireFunction · 0.50
towire_boolFunction · 0.50

Tested by

no test coverage detected