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

Function tlvstream_set_raw

wire/tlvstream.c:51–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 6

keysend_cbFunction · 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