Skip to content

Commit

Permalink
Don't respond with getdata for legacy inv types when spork15 is active (
Browse files Browse the repository at this point in the history
#2528)

Avoid unnecessary traffic from non-upgraded nodes.
  • Loading branch information
codablock authored Dec 6, 2018
1 parent d2ca9ed commit 19a6f71
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1786,6 +1786,18 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
}
else
{
static std::set<int> legacyMNObjs = {
MSG_MASTERNODE_PAYMENT_VOTE,
MSG_MASTERNODE_PAYMENT_BLOCK,
MSG_MASTERNODE_ANNOUNCE,
MSG_MASTERNODE_PING,
MSG_MASTERNODE_VERIFY,
};
if (legacyMNObjs.count(inv.type) && deterministicMNManager->IsDeterministicMNsSporkActive()) {
LogPrint("net", "ignoring (%s) inv of legacy type %d peer=%d\n", inv.hash.ToString(), inv.type, pfrom->id);
continue;
}

pfrom->AddInventoryKnown(inv);
if (fBlocksOnly)
LogPrint("net", "transaction (%s) inv sent in violation of protocol peer=%d\n", inv.hash.ToString(), pfrom->id);
Expand Down

0 comments on commit 19a6f71

Please sign in to comment.