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

Function towire_tlvstream_raw

wire/tlvstream.c:23–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21}
22
23void towire_tlvstream_raw(u8 **pptr, struct tlv_field *fields)
24{
25 if (!fields)
26 return;
27
28 asort(fields, tal_count(fields), tlv_field_cmp, NULL);
29
30 for (size_t i = 0; i < tal_count(fields); i++) {
31 const struct tlv_field *field = &fields[i];
32 /* BOLT #1:
33 *
34 * The sending node:
35 ...
36 * - MUST minimally encode `type` and `length`.
37 */
38 towire_bigsize(pptr, field->numtype);
39 towire_bigsize(pptr, field->length);
40 towire(pptr, field->value, field->length);
41 }
42}
43
44static struct tlv_field *tlvstream_get_raw(struct tlv_field *stream, u64 type)
45{

Callers 9

handle_onionFunction · 0.85
send_htlc_outFunction · 0.85
peer_accepted_htlcFunction · 0.85
make_unsigned_proof_Function · 0.85
towire_len_and_tlvstreamFunction · 0.85
mainFunction · 0.85
htlc_accepted_continueFunction · 0.85
payment_sendonionFunction · 0.85
json_xkeysendFunction · 0.85

Calls 2

towireFunction · 0.70
towire_bigsizeFunction · 0.50

Tested by 1

mainFunction · 0.68