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

Function towire_existing_htlc

common/htlc_wire.c:116–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116void towire_existing_htlc(u8 **pptr, const struct existing_htlc *existing)
117{
118 towire_u8(pptr, existing->state);
119 towire_u64(pptr, existing->id);
120 towire_amount_msat(pptr, existing->amount);
121 towire_sha256(pptr, &existing->payment_hash);
122 towire_u32(pptr, existing->cltv_expiry);
123 towire(pptr, existing->onion_routing_packet,
124 sizeof(existing->onion_routing_packet));
125 if (existing->payment_preimage) {
126 towire_bool(pptr, true);
127 towire_preimage(pptr, existing->payment_preimage);
128 } else
129 towire_bool(pptr, false);
130 if (existing->failed) {
131 towire_bool(pptr, true);
132 towire_failed_htlc(pptr, existing->failed);
133 } else
134 towire_bool(pptr, false);
135 if (existing->path_key) {
136 towire_bool(pptr, true);
137 towire_pubkey(pptr, existing->path_key);
138 } else
139 towire_bool(pptr, false);
140 if (existing->extra_tlvs) {
141 towire_bool(pptr, true);
142 towire_len_and_tlvstream(pptr, existing->extra_tlvs);
143 } else
144 towire_bool(pptr, false);
145}
146
147void towire_fulfilled_htlc(u8 **pptr, const struct fulfilled_htlc *fulfilled)
148{

Callers

nothing calls this directly

Calls 11

towire_preimageFunction · 0.85
towire_failed_htlcFunction · 0.85
towire_pubkeyFunction · 0.85
towire_len_and_tlvstreamFunction · 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