aboutsummaryrefslogtreecommitdiff
path: root/src/streams.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-02-02 18:34:30 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-02-09 17:21:01 +0100
commitfa56c79df91e5d87533af38b64f4f4148a48a276 (patch)
tree51d90ae5872067f354e1e7667ee385ab407f69db /src/streams.h
parentfab02f799194c75af7def3a2ab45c443b75de230 (diff)
downloadbitcoin-fa56c79df91e5d87533af38b64f4f4148a48a276.tar.xz
Make CDataStream work properly on 64-bit systems
Diffstat (limited to 'src/streams.h')
-rw-r--r--src/streams.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/streams.h b/src/streams.h
index e485c09457..3ffdb50c76 100644
--- a/src/streams.h
+++ b/src/streams.h
@@ -187,7 +187,7 @@ class CDataStream
protected:
using vector_type = SerializeData;
vector_type vch;
- unsigned int nReadPos{0};
+ vector_type::size_type nReadPos{0};
int nType;
int nVersion;
@@ -282,7 +282,7 @@ public:
if (dst.size() == 0) return;
// Read from the beginning of the buffer
- auto next_read_pos{CheckedAdd<uint32_t>(nReadPos, dst.size())};
+ auto next_read_pos{CheckedAdd(nReadPos, dst.size())};
if (!next_read_pos.has_value() || next_read_pos.value() > vch.size()) {
throw std::ios_base::failure("CDataStream::read(): end of data");
}
@@ -298,7 +298,7 @@ public:
void ignore(size_t num_ignore)
{
// Ignore from the beginning of the buffer
- auto next_read_pos{CheckedAdd<uint32_t>(nReadPos, num_ignore)};
+ auto next_read_pos{CheckedAdd(nReadPos, num_ignore)};
if (!next_read_pos.has_value() || next_read_pos.value() > vch.size()) {
throw std::ios_base::failure("CDataStream::ignore(): end of data");
}