| 50 | } |
| 51 | |
| 52 | void 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 | |
| 69 | void tlvstream_set_short_channel_id(struct tlv_field **stream, u64 type, |
| 70 | struct short_channel_id value) |
no test coverage detected