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

Function sphinx_add_hop

common/sphinx.c:128–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void sphinx_add_hop(struct sphinx_path *path, const struct pubkey *pubkey,
129 const u8 *payload TAKES)
130{
131 u8 *with_len = tal_arr(NULL, u8, 0);
132 size_t len = tal_bytelen(payload);
133 towire_bigsize(&with_len, len);
134 towire_u8_array(&with_len, payload, len);
135 if (taken(payload))
136 tal_free(payload);
137
138 if (!sphinx_add_hop_has_length(path, pubkey, take(with_len)))
139 abort();
140}
141
142/* Small helper to append data to a buffer and update the position
143 * into the buffer

Callers 4

json_sendonionmessageFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
runtestFunction · 0.85

Calls 7

tal_bytelenFunction · 0.85
takenFunction · 0.85
tal_freeFunction · 0.85
abortFunction · 0.85
towire_bigsizeFunction · 0.70
towire_u8_arrayFunction · 0.50

Tested by 2

mainFunction · 0.68
mainFunction · 0.68