Skip to content

Commit

Permalink
Merge pull request bitcoin#583 from nomnombtc/noban_wlist_dev
Browse files Browse the repository at this point in the history
do not ban whitelisted peers
  • Loading branch information
gandrewstone authored May 24, 2017
2 parents afe96b0 + 56b22ab commit c1554bb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5882,7 +5882,7 @@ bool ProcessMessage(CNode *pfrom, std::string strCommand, CDataStream &vRecv, in
}


else if (pfrom->nVersion == 0)
else if (pfrom->nVersion == 0 && !pfrom->fWhitelisted)
{
// Must have version message before anything else (Although we may send our VERSION before
// we receive theirs, it would not be possible to receive their VERACK before their VERSION).
Expand Down Expand Up @@ -7066,7 +7066,10 @@ bool ProcessMessages(CNode *pfrom)
{
LogPrintf("PROCESSMESSAGE: INVALID MESSAGESTART %s peer=%d ip=%s\n", SanitizeString(msg.hdr.GetCommand()),
pfrom->id, pfrom->addrName.c_str());
CNode::Ban(pfrom->addr, BanReasonNodeMisbehaving, 4 * 60 * 60); // ban for 4 hours
if (!pfrom->fWhitelisted)
{
CNode::Ban(pfrom->addr, BanReasonNodeMisbehaving, 4 * 60 * 60); // ban for 4 hours
}
fOk = false;
break;
}
Expand Down Expand Up @@ -7299,7 +7302,7 @@ bool SendMessages(CNode *pto)
// If not then disconnect and ban the node and a new node will automatically be selected to start the headers
// download.
if ((state.fSyncStarted) && (state.fSyncStartTime < GetTime() - INITIAL_HEADERS_TIMEOUT) &&
(!state.fFirstHeadersReceived))
(!state.fFirstHeadersReceived) && !pto->fWhitelisted)
{
pto->fDisconnect = true;
CNode::Ban(pto->addr, BanReasonNodeMisbehaving, 4 * 60 * 60); // ban for 4 hours
Expand Down

0 comments on commit c1554bb

Please sign in to comment.