Browse Source

Merge pull request #4903

efad808 Avoid reject message feedback loops (Pieter Wuille)
0.10
Pieter Wuille 10 years ago
parent
commit
13168ea46c
No known key found for this signature in database
GPG Key ID: 8F653255C87992E0
  1. 8
      src/main.cpp

8
src/main.cpp

@ -4111,8 +4111,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, @@ -4111,8 +4111,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
else if (strCommand == "reject")
{
if (fDebug)
{
if (fDebug) {
try {
string strMsg; unsigned char ccode; string strReason;
vRecv >> LIMITED_STRING(strMsg, CMessageHeader::COMMAND_SIZE) >> ccode >> LIMITED_STRING(strReason, 111);
@ -4126,6 +4126,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, @@ -4126,6 +4126,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
ss << ": hash " << hash.ToString();
}
LogPrint("net", "Reject %s\n", SanitizeString(ss.str()));
} catch (std::ios_base::failure& e) {
// Avoid feedback loops by preventing reject messages from triggering a new reject message.
LogPrint("net", "Unparseable reject message received\n");
}
}
}

Loading…
Cancel
Save