Skip to content

Commit

Permalink
Merge pull request #189 from TheLindaProjectInc/net-peer-upgrade-fix
Browse files Browse the repository at this point in the history
Fix network version check bug
  • Loading branch information
nibbles83 authored Sep 8, 2022
2 parents 846277d + ee6d3c3 commit 5b47203
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 4)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 9)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2022)
Expand Down
6 changes: 3 additions & 3 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2141,13 +2141,13 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
}
}

if(::ChainActive().Tip()->nHeight >= chainparams.GetConsensus().MIP2Height){
if (nVersion < MIN_PEER_PROTO_VERSION_AFTER_MIP2 + 15000) {
if(::ChainActive().Tip()->nHeight >= chainparams.GetConsensus().MIP2Height + 15000){
if (nVersion < MIN_PEER_PROTO_VERSION_AFTER_MIP2) {
// disconnect from peers older than this proto version
LogPrint(BCLog::NET, "peer=%d using obsolete version after MIP2 fork %i; disconnecting\n", pfrom->GetId(), nVersion);
if (enable_bip61) {
connman->PushMessage(pfrom, CNetMsgMaker(INIT_PROTO_VERSION).Make(NetMsgType::REJECT, strCommand, REJECT_OBSOLETE,
strprintf("Version must be %d or greater after MIP2 fork", MIN_PEER_PROTO_VERSION_AFTER_MIP1)));
strprintf("Version must be %d or greater after MIP2 fork", MIN_PEER_PROTO_VERSION_AFTER_MIP2)));
}
pfrom->fDisconnect = true;
return false;
Expand Down

0 comments on commit 5b47203

Please sign in to comment.