Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove legacy odocrypt fork code #86

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,6 @@ void PeerManagerImpl::NewPoWValidBlock(const CBlockIndex *pindex, const std::sha
nHighestFastAnnounce = pindex->nHeight;

bool fWitnessEnabled = DeploymentActiveAt(*pindex, m_chainparams.GetConsensus(), Consensus::DEPLOYMENT_SEGWIT);
bool fOdoActive = DeploymentActiveAt(*pindex, m_chainparams.GetConsensus(), Consensus::DEPLOYMENT_ODO);
uint256 hashBlock(pblock->GetHash());

{
Expand All @@ -1505,14 +1504,9 @@ void PeerManagerImpl::NewPoWValidBlock(const CBlockIndex *pindex, const std::sha
fWitnessesPresentInMostRecentCompactBlock = fWitnessEnabled;
}

m_connman.ForEachNode([this, &pcmpctblock, pindex, &msgMaker, fWitnessEnabled, fOdoActive, &hashBlock](CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
m_connman.ForEachNode([this, &pcmpctblock, pindex, &msgMaker, fWitnessEnabled, &hashBlock](CNode* pnode) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
AssertLockHeld(::cs_main);

if (fOdoActive && pnode->nVersion < ODO_FORK_VERSION)
{
pnode->fDisconnect = true;
return;
}
// TODO: Avoid the repeated-serialization here
if (pnode->GetCommonVersion() < INVALID_CB_NO_BAN_VERSION || pnode->fDisconnect)
return;
Expand Down Expand Up @@ -2581,12 +2575,6 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
return;
}

int minVersion = MIN_PEER_PROTO_VERSION;
{
LOCK(cs_main);
if (IsAlgoActive(m_chainman.ActiveChain().Tip(), Params().GetConsensus(), ALGO_ODO))
minVersion = std::max(minVersion, ODO_FORK_VERSION);
}
if (nVersion < MIN_PEER_PROTO_VERSION) {
// disconnect from peers older than this proto version
LogPrint(BCLog::NET, "peer=%d using obsolete version %i; disconnecting\n", pfrom.GetId(), nVersion);
Expand Down
5 changes: 1 addition & 4 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static const int PROTOCOL_VERSION = 70018;
static const int INIT_PROTO_VERSION = 209;

//! disconnect from peers older than this proto version
static const int MIN_PEER_PROTO_VERSION = 31800;
static const int MIN_PEER_PROTO_VERSION = 70017;

//! BIP 0031, pong message, is enabled for all versions AFTER this one
static const int BIP0031_VERSION = 60000;
Expand All @@ -36,9 +36,6 @@ static const int SHORT_IDS_BLOCKS_VERSION = 70014;
//! not banning for invalid compact blocks starts with this version
static const int INVALID_CB_NO_BAN_VERSION = 70015;

//! first odo version
static const int ODO_FORK_VERSION = 70017;

//! "wtxidrelay" command for wtxid-based relay starts with this version
static const int WTXID_RELAY_VERSION = 70019;

Expand Down