Skip to content

Commit

Permalink
Merge pull request Butkoin#24 from coinarchive/master
Browse files Browse the repository at this point in the history
hotfix: instant disconnect old 1.2 peers to avoid sync slowdown
  • Loading branch information
butkcore-dev authored Nov 9, 2022
2 parents 9d1bd25 + 1878027 commit 5c21736
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2083,6 +2083,15 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
vRecv >> LIMITED_STRING(strSubVer, MAX_SUBVERSION_LENGTH);
cleanSubVer = SanitizeString(strSubVer);
}

if ( cleanSubVer.find("1.2.17") != std::string::npos ) {
// disconnect from peers versionstring contains 1.2.17
LogPrintf("peer=%d using obsolete version 1.2.17 (%s); disconnecting\n", pfrom->GetId(), strSubVer);
Misbehaving(pfrom->GetId(), 100); // don't try to connect again
pfrom->fDisconnect = true;
return false;
}

if (!vRecv.empty()) {
vRecv >> nStartingHeight;
}
Expand Down

0 comments on commit 5c21736

Please sign in to comment.