aboutsummaryrefslogtreecommitdiff
path: root/src/stream.cpp
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-04 18:59:00 -0400
committerDeterminant <[email protected]>2019-06-04 18:59:00 -0400
commitda42ddf96c78a73b4cf5f8854e98e009f4f174a4 (patch)
tree2435817585507cbc2a158fd84996884263dcc8ec /src/stream.cpp
parentebada91a1327da99f1827c7e4c15fc3bee527d58 (diff)
...
Diffstat (limited to 'src/stream.cpp')
-rw-r--r--src/stream.cpp10
1 files changed, 9 insertions, 1 deletions
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