|
|
@ -3559,7 +3559,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|
|
|
if (!vRecv.empty())
|
|
|
|
if (!vRecv.empty())
|
|
|
|
vRecv >> addrFrom >> nNonce;
|
|
|
|
vRecv >> addrFrom >> nNonce;
|
|
|
|
if (!vRecv.empty()) {
|
|
|
|
if (!vRecv.empty()) {
|
|
|
|
vRecv >> pfrom->strSubVer;
|
|
|
|
vRecv >> LIMITED_STRING(pfrom->strSubVer, 256);
|
|
|
|
pfrom->cleanSubVer = SanitizeString(pfrom->strSubVer);
|
|
|
|
pfrom->cleanSubVer = SanitizeString(pfrom->strSubVer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!vRecv.empty())
|
|
|
|
if (!vRecv.empty())
|
|
|
@ -4183,7 +4183,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|
|
|
if (fDebug)
|
|
|
|
if (fDebug)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string strMsg; unsigned char ccode; string strReason;
|
|
|
|
string strMsg; unsigned char ccode; string strReason;
|
|
|
|
vRecv >> strMsg >> ccode >> strReason;
|
|
|
|
vRecv >> LIMITED_STRING(strMsg, CMessageHeader::COMMAND_SIZE) >> ccode >> LIMITED_STRING(strReason, 111);
|
|
|
|
|
|
|
|
|
|
|
|
ostringstream ss;
|
|
|
|
ostringstream ss;
|
|
|
|
ss << strMsg << " code " << itostr(ccode) << ": " << strReason;
|
|
|
|
ss << strMsg << " code " << itostr(ccode) << ": " << strReason;
|
|
|
@ -4194,10 +4194,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|
|
|
vRecv >> hash;
|
|
|
|
vRecv >> hash;
|
|
|
|
ss << ": hash " << hash.ToString();
|
|
|
|
ss << ": hash " << hash.ToString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Truncate to reasonable length and sanitize before printing:
|
|
|
|
LogPrint("net", "Reject %s\n", SanitizeString(ss.str()));
|
|
|
|
string s = ss.str();
|
|
|
|
|
|
|
|
if (s.size() > 111) s.erase(111, string::npos);
|
|
|
|
|
|
|
|
LogPrint("net", "Reject %s\n", SanitizeString(s));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|