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

Function tlvstream_set_raw

wire/tlvstream.c:52–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void tlvstream_set_raw(struct tlv_field **stream, u64 type, const void *value TAKES, size_t valuelen)
53{
54 struct tlv_field f, *e = tlvstream_get_raw(*stream, type);
55
56 if (e != NULL) {
57 tal_free(e->value);
58 e->length = valuelen;
59 e->value = tal_dup_arr(*stream, u8, value, e->length, 0);
60 } else {
61 /* If we haven't found it insert it insead. We have no
62 * tlv_record_type for it, so it's an unknown field. */
63 f.meta = NULL;
64 f.length = valuelen;
65 f.numtype = type;
66 f.value = tal_dup_arr(*stream, u8, value, f.length, 0);
67 tal_arr_expand(stream, f);
68 }
69}
70
71void tlvstream_set_short_channel_id(struct tlv_field **stream, u64 type,
72 struct short_channel_id value)

Callers 7

keysend_cbFunction · 0.85
json_xkeysendFunction · 0.85
tlvstream_set_tu64Function · 0.85
tlvstream_set_tu32Function · 0.85

Calls 2

tlvstream_get_rawFunction · 0.85
tal_freeFunction · 0.85

Tested by

no test coverage detected