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

Function towire_added_htlc

common/htlc_wire.c:95–114  ·  view source on GitHub ↗

FIXME: We could adapt tools/generate-wire.py to generate structures * and code like this. */

Source from the content-addressed store, hash-verified

93/* FIXME: We could adapt tools/generate-wire.py to generate structures
94 * and code like this. */
95void towire_added_htlc(u8 **pptr, const struct added_htlc *added)
96{
97 towire_u64(pptr, added->id);
98 towire_amount_msat(pptr, added->amount);
99 towire_sha256(pptr, &added->payment_hash);
100 towire_u32(pptr, added->cltv_expiry);
101 towire(pptr, added->onion_routing_packet,
102 sizeof(added->onion_routing_packet));
103 if (added->path_key) {
104 towire_bool(pptr, true);
105 towire_pubkey(pptr, added->path_key);
106 } else
107 towire_bool(pptr, false);
108 if (added->extra_tlvs) {
109 towire_bool(pptr, true);
110 towire_len_and_tlvstream(pptr, added->extra_tlvs);
111 } else
112 towire_bool(pptr, false);
113 towire_bool(pptr, added->fail_immediate);
114}
115
116void towire_existing_htlc(u8 **pptr, const struct existing_htlc *existing)
117{

Callers

nothing calls this directly

Calls 8

towire_pubkeyFunction · 0.85
towire_len_and_tlvstreamFunction · 0.85
towire_amount_msatFunction · 0.70
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