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