diff options
author | Troy Giorshev <troygiorshev@gmail.com> | 2020-05-26 17:01:57 -0400 |
---|---|---|
committer | Troy Giorshev <troygiorshev@gmail.com> | 2020-09-22 22:05:18 -0400 |
commit | deb52711a17236d0fca302701b5af585341ab42a (patch) | |
tree | 992c541c6fa43979adcf0436a01064ce497c1a84 /src/net.h | |
parent | 52d4ae46ab822d0f54e246a6f2364415cda149bd (diff) |
Remove header checks out of net_processing
This moves header size and netmagic checking out of net_processing and
into net. This check now runs in ReadHeader, so that net can exit early
out of receiving bytes from the peer. IsValid is now slimmed down, so
it no longer needs a MessageStartChars& parameter.
Additionally this removes the rest of the m_valid_* members from
CNetMessage.
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -706,10 +706,8 @@ class CNetMessage { public: CDataStream m_recv; //!< received message data std::chrono::microseconds m_time{0}; //!< time of message receipt - bool m_valid_netmagic = false; - bool m_valid_header = false; - uint32_t m_message_size{0}; //!< size of the payload - uint32_t m_raw_message_size{0}; //!< used wire size of the message (including header/checksum) + uint32_t m_message_size{0}; //!< size of the payload + uint32_t m_raw_message_size{0}; //!< used wire size of the message (including header/checksum) std::string m_command; CNetMessage(CDataStream&& recv_in) : m_recv(std::move(recv_in)) {} |