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

Function tlvstream_set_raw

wire/tlvstream.c:52–67  ·  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. */
62 f.length = valuelen;
63 f.numtype = type;
64 f.value = tal_dup_arr(*stream, u8, value, f.length, 0);
65 tal_arr_expand(stream, f);
66 }
67}
68
69void tlvstream_set_short_channel_id(struct tlv_field **stream, u64 type,
70 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