aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorTroy Giorshev <troygiorshev@gmail.com>2020-05-26 17:01:57 -0400
committerTroy Giorshev <troygiorshev@gmail.com>2020-09-22 22:05:18 -0400
commitdeb52711a17236d0fca302701b5af585341ab42a (patch)
tree992c541c6fa43979adcf0436a01064ce497c1a84 /src/net.h
parent52d4ae46ab822d0f54e246a6f2364415cda149bd (diff)
downloadbitcoin-deb52711a17236d0fca302701b5af585341ab42a.tar.xz
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.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/net.h b/src/net.h
index 29941b9622..9a92f80511 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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)) {}