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

Function sphinx_add_hop

common/sphinx.c:157–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void sphinx_add_hop(struct sphinx_path *path, const struct pubkey *pubkey,
158 const u8 *payload TAKES)
159{
160 u8 *with_len = tal_arr(NULL, u8, 0);
161 size_t len = tal_bytelen(payload);
162 towire_bigsize(&with_len, len);
163 towire_u8_array(&with_len, payload, len);
164 tal_free_if_taken(payload);
165
166 if (!sphinx_add_hop_has_length(path, pubkey, take(with_len)))
167 abort();
168}
169
170/* Small helper to append data to a buffer and update the position
171 * into the buffer

Callers 5

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
inject_onionmessage_Function · 0.85
runtestFunction · 0.85

Calls 6

tal_bytelenFunction · 0.85
tal_free_if_takenFunction · 0.85
abortFunction · 0.85
towire_bigsizeFunction · 0.70
towire_u8_arrayFunction · 0.50

Tested by 3

mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68