diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-11-20 10:16:10 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-11-20 15:11:21 +0100 |
commit | fabecce71909c984504c21fa05f91d5f1b471e8c (patch) | |
tree | 189a31d8bfd4c649df69542d783e4d702d21baac /src/net.h | |
parent | fdd068507d2694137d72638d87ea961e6f16a753 (diff) | |
download | bitcoin-fabecce71909c984504c21fa05f91d5f1b471e8c.tar.xz |
net: Treat raw message bytes as uint8_t
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -758,7 +758,7 @@ public: // set the serialization context version virtual void SetVersion(int version) = 0; /** read and deserialize data, advances msg_bytes data pointer */ - virtual int Read(Span<const char>& msg_bytes) = 0; + virtual int Read(Span<const uint8_t>& msg_bytes) = 0; // decomposes a message from the context virtual Optional<CNetMessage> GetMessage(std::chrono::microseconds time, uint32_t& out_err) = 0; virtual ~TransportDeserializer() {} @@ -779,8 +779,8 @@ private: unsigned int nDataPos; const uint256& GetMessageHash() const; - int readHeader(Span<const char> msg_bytes); - int readData(Span<const char> msg_bytes); + int readHeader(Span<const uint8_t> msg_bytes); + int readData(Span<const uint8_t> msg_bytes); void Reset() { vRecv.clear(); @@ -814,7 +814,7 @@ public: hdrbuf.SetVersion(nVersionIn); vRecv.SetVersion(nVersionIn); } - int Read(Span<const char>& msg_bytes) override + int Read(Span<const uint8_t>& msg_bytes) override { int ret = in_data ? readData(msg_bytes) : readHeader(msg_bytes); if (ret < 0) { @@ -1132,7 +1132,7 @@ public: * @return True if the peer should stay connected, * False if the peer should be disconnected from. */ - bool ReceiveMsgBytes(Span<const char> msg_bytes, bool& complete); + bool ReceiveMsgBytes(Span<const uint8_t> msg_bytes, bool& complete); void SetCommonVersion(int greatest_common_version) { |