Changeset View
Changeset View
Standalone View
Standalone View
src/net_processing.cpp
Show First 20 Lines • Show All 3,393 Lines • ▼ Show 20 Lines | bool PeerLogicValidation::ProcessMessages(const Config &config, CNode *pfrom, | ||||
unsigned int nMessageSize = hdr.nMessageSize; | unsigned int nMessageSize = hdr.nMessageSize; | ||||
// Checksum | // Checksum | ||||
CDataStream &vRecv = msg.vRecv; | CDataStream &vRecv = msg.vRecv; | ||||
const uint256 &hash = msg.GetMessageHash(); | const uint256 &hash = msg.GetMessageHash(); | ||||
if (memcmp(hash.begin(), hdr.pchChecksum, CMessageHeader::CHECKSUM_SIZE) != | if (memcmp(hash.begin(), hdr.pchChecksum, CMessageHeader::CHECKSUM_SIZE) != | ||||
0) { | 0) { | ||||
LogPrint( | LogPrint( | ||||
BCLog::NET, "%s(%s, %u bytes): CHECKSUM ERROR expected %s was %s\n", | BCLog::NET, | ||||
"%s(%s, %u bytes): CHECKSUM ERROR expected %s was %s from " | |||||
"peer=%d\n", | |||||
__func__, SanitizeString(strCommand), nMessageSize, | __func__, SanitizeString(strCommand), nMessageSize, | ||||
HexStr(hash.begin(), hash.begin() + CMessageHeader::CHECKSUM_SIZE), | HexStr(hash.begin(), hash.begin() + CMessageHeader::CHECKSUM_SIZE), | ||||
HexStr(hdr.pchChecksum, | HexStr(hdr.pchChecksum, | ||||
hdr.pchChecksum + CMessageHeader::CHECKSUM_SIZE)); | hdr.pchChecksum + CMessageHeader::CHECKSUM_SIZE), | ||||
pfrom->GetId()); | |||||
connman->Ban(pfrom->addr, BanReasonNodeMisbehaving); | |||||
return fMoreWork; | return fMoreWork; | ||||
} | } | ||||
// Process message | // Process message | ||||
bool fRet = false; | bool fRet = false; | ||||
try { | try { | ||||
fRet = ProcessMessage(config, pfrom, strCommand, vRecv, msg.nTime, | fRet = ProcessMessage(config, pfrom, strCommand, vRecv, msg.nTime, | ||||
connman, interruptMsgProc); | connman, interruptMsgProc); | ||||
▲ Show 20 Lines • Show All 912 Lines • Show Last 20 Lines |