From da42ddf96c78a73b4cf5f8854e98e009f4f174a4 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 4 Jun 2019 18:59:00 -0400 Subject: ... --- src/stream.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/stream.cpp') diff --git a/src/stream.cpp b/src/stream.cpp index f3dd322..ec1d5da 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -51,7 +51,7 @@ void datastream_put_i16(datastream_t *self, int16_t val) { *self << val; } void datastream_put_i32(datastream_t *self, int32_t val) { *self << val; } void datastream_put_data(datastream_t *self, - uint8_t *begin, uint8_t *end) { + const uint8_t *begin, const uint8_t *end) { self->put_data(begin, end); } @@ -87,6 +87,14 @@ uint256_t *datastream_get_hash(const datastream_t *self) { return new uint256_t(self->get_hash()); } +void datastream_free(const datastream_t *self) { delete self; } + +bytearray_t *datastream_to_bytearray(datastream_t *self) { + auto res = new bytearray_t(std::move(*self)); + delete self; + return res; +} + } #endif -- cgit v1.2.3