aboutsummaryrefslogtreecommitdiff
path: root/src/stream.cpp
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-11 14:25:40 -0400
committerDeterminant <[email protected]>2019-06-11 14:25:40 -0400
commitef377f5d85503451a16d50fbc535a7537a28b57f (patch)
treea57d9268a0984107ad7b483c942a992df6e6a6ec /src/stream.cpp
parent05ffb2ce9f4a0cbaca05a1d46b040743d661ce25 (diff)
...
Diffstat (limited to 'src/stream.cpp')
-rw-r--r--src/stream.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/stream.cpp b/src/stream.cpp
index 3e24292..b14bd6a 100644
--- a/src/stream.cpp
+++ b/src/stream.cpp
@@ -24,8 +24,8 @@ void uint256_unserialize(uint256_t *self, datastream_t *s) {
}
datastream_t *datastream_new() { return new datastream_t(); }
-datastream_t *datastream_new_from_bytes(const uint8_t *begin, const uint8_t *end) {
- return new datastream_t(begin, end);
+datastream_t *datastream_new_from_bytes(const uint8_t *base, size_t size) {
+ return new datastream_t(base, base + size);
}
void datastream_free(const datastream_t *self) { delete self; }
@@ -54,9 +54,8 @@ 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_i64(datastream_t *self, int64_t val) { *self << val; }
-void datastream_put_data(datastream_t *self,
- const uint8_t *begin, const uint8_t *end) {
- self->put_data(begin, end);
+void datastream_put_data(datastream_t *self, const uint8_t *base, size_t size) {
+ self->put_data(base, base + size);
}
uint8_t datastream_get_u8(datastream_t *self) { uint8_t val; *self >> val; return val; }