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

Function make_v0_hop

common/sphinx.c:130–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130static u8 *make_v0_hop(const tal_t *ctx,
131 const struct short_channel_id *scid,
132 struct amount_msat forward, u32 outgoing_cltv)
133{
134 const u8 padding[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
135 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
136 /* Prepend 0 byte for realm */
137 u8 *buf = tal_arrz(ctx, u8, 1);
138 towire_short_channel_id(&buf, *scid);
139 towire_amount_msat(&buf, forward);
140 towire_u32(&buf, outgoing_cltv);
141 towire(&buf, padding, ARRAY_SIZE(padding));
142 assert(tal_bytelen(buf) == 1 + 32);
143 return buf;
144}
145
146void sphinx_add_v0_hop(struct sphinx_path *path, const struct pubkey *pubkey,
147 const struct short_channel_id *scid,

Callers 1

sphinx_add_v0_hopFunction · 0.85

Calls 5

towire_short_channel_idFunction · 0.85
tal_bytelenFunction · 0.85
towire_amount_msatFunction · 0.70
towire_u32Function · 0.50
towireFunction · 0.50

Tested by

no test coverage detected