aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorTroy Giorshev <troygiorshev@gmail.com>2020-11-05 05:05:32 -0500
committerJohn Newbery <john@johnnewbery.com>2021-08-19 18:20:12 +0100
commit8c96008ab18075abca03bff6b3675643825a21ca (patch)
tree846de8ab8fccf225350fcd8fe409a95089f0b21a /src/net.h
parente35c4a3d80578e8feff1f1ae5db81d3c0992a865 (diff)
[net] Don't return an optional from TransportDeserializer::GetMessage()
Also, access mapRecvBytesPerMsgCmd with `at()` not `find()`. This throws an error if COMMAND_OTHER doesn't exist, which should never happen. `find()` instead just accessed the last element, which could make debugging more difficult. Resolves review comments from PR19107: - https://github.com/bitcoin/bitcoin/pull/19107#discussion_r478718436 - https://github.com/bitcoin/bitcoin/pull/19107#discussion_r478714497
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index 28cd635976..1f43433f9f 100644
--- a/src/net.h
+++ b/src/net.h
@@ -309,7 +309,7 @@ public:
/** read and deserialize data, advances msg_bytes data pointer */
virtual int Read(Span<const uint8_t>& msg_bytes) = 0;
// decomposes a message from the context
- virtual std::optional<CNetMessage> GetMessage(std::chrono::microseconds time, uint32_t& out_err) = 0;
+ virtual CNetMessage GetMessage(std::chrono::microseconds time, bool& reject_message) = 0;
virtual ~TransportDeserializer() {}
};
@@ -373,7 +373,7 @@ public:
}
return ret;
}
- std::optional<CNetMessage> GetMessage(std::chrono::microseconds time, uint32_t& out_err_raw_size) override;
+ CNetMessage GetMessage(std::chrono::microseconds time, bool& reject_message) override;
};
/** The TransportSerializer prepares messages for the network transport