From 56b22aba49e5f4c395aa74299422a857805c5acc Mon Sep 17 00:00:00 2001 From: nomnombtc Date: Sun, 14 May 2017 18:01:13 +0200 Subject: [PATCH] do not ban whitelisted peers --- src/main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index f623cda7effa4..e71cfda0a95ca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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). @@ -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; } @@ -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