aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorTroy Giorshev <troygiorshev@gmail.com>2020-06-29 14:15:06 -0400
committerTroy Giorshev <troygiorshev@gmail.com>2020-09-22 22:01:14 -0400
commit890b1d7c2b8312d41d048d2db124586c5dbc8a49 (patch)
tree8ef643a06cbda557a380e7fa261af30c47bcac35 /src/net_processing.cpp
parent2716647ebf60cea05fc9edce6a18dcce4e7727ad (diff)
downloadbitcoin-890b1d7c2b8312d41d048d2db124586c5dbc8a49.tar.xz
Move checksum check from net_processing to net
This removes the m_valid_checksum member from CNetMessage. Instead, GetMessage() returns an Optional. Additionally, GetMessage() has been given an out parameter to be used to hold error information. For now it is specifically a uint32_t used to hold the raw size of the corrupt message. The checksum check is now done in GetMessage.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 690b59476b..d9d32cded6 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -3886,17 +3886,8 @@ bool PeerManager::ProcessMessages(CNode* pfrom, std::atomic<bool>& interruptMsgP
// Message size
unsigned int nMessageSize = msg.m_message_size;
- // Checksum
- CDataStream& vRecv = msg.m_recv;
- if (!msg.m_valid_checksum)
- {
- LogPrint(BCLog::NET, "%s(%s, %u bytes): CHECKSUM ERROR peer=%d\n", __func__,
- SanitizeString(msg_type), nMessageSize, pfrom->GetId());
- return fMoreWork;
- }
-
try {
- ProcessMessage(*pfrom, msg_type, vRecv, msg.m_time, interruptMsgProc);
+ ProcessMessage(*pfrom, msg_type, msg.m_recv, msg.m_time, interruptMsgProc);
if (interruptMsgProc)
return false;
if (!pfrom->vRecvGetData.empty())