Skip to content

Commit

Permalink
test: Remove unused nVersion=1 in p2p tests
Browse files Browse the repository at this point in the history
After commit ddefb5c nVersion is no
longer used in p2p logic when sending messages. Only when receiving
messages, but in this test no messages are received.
  • Loading branch information
MarcoFalke committed Oct 12, 2020
1 parent 12a1c3a commit faad92f
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/test/denialofservice_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ BOOST_AUTO_TEST_CASE(outbound_slow_chain_eviction)
dummyNode1.SetCommonVersion(PROTOCOL_VERSION);

peerLogic->InitializeNode(&dummyNode1);
dummyNode1.nVersion = 1;
dummyNode1.fSuccessfullyConnected = true;

// This test requires that we have a chain with non-zero work.
Expand Down Expand Up @@ -141,7 +140,6 @@ static void AddRandomOutboundPeer(std::vector<CNode *> &vNodes, PeerManager &pee
node.SetCommonVersion(PROTOCOL_VERSION);

peerLogic.InitializeNode(&node);
node.nVersion = 1;
node.fSuccessfullyConnected = true;

connman->AddNode(node);
Expand Down Expand Up @@ -231,7 +229,6 @@ BOOST_AUTO_TEST_CASE(peer_discouragement)
CNode dummyNode1(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr1, 0, 0, CAddress(), "", ConnectionType::INBOUND);
dummyNode1.SetCommonVersion(PROTOCOL_VERSION);
peerLogic->InitializeNode(&dummyNode1);
dummyNode1.nVersion = 1;
dummyNode1.fSuccessfullyConnected = true;
peerLogic->Misbehaving(dummyNode1.GetId(), DISCOURAGEMENT_THRESHOLD, /* message */ ""); // Should be discouraged
{
Expand All @@ -245,7 +242,6 @@ BOOST_AUTO_TEST_CASE(peer_discouragement)
CNode dummyNode2(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr2, 1, 1, CAddress(), "", ConnectionType::INBOUND);
dummyNode2.SetCommonVersion(PROTOCOL_VERSION);
peerLogic->InitializeNode(&dummyNode2);
dummyNode2.nVersion = 1;
dummyNode2.fSuccessfullyConnected = true;
peerLogic->Misbehaving(dummyNode2.GetId(), DISCOURAGEMENT_THRESHOLD - 1, /* message */ "");
{
Expand Down Expand Up @@ -282,7 +278,6 @@ BOOST_AUTO_TEST_CASE(DoS_bantime)
CNode dummyNode(id++, NODE_NETWORK, 0, INVALID_SOCKET, addr, 4, 4, CAddress(), "", ConnectionType::INBOUND);
dummyNode.SetCommonVersion(PROTOCOL_VERSION);
peerLogic->InitializeNode(&dummyNode);
dummyNode.nVersion = 1;
dummyNode.fSuccessfullyConnected = true;

peerLogic->Misbehaving(dummyNode.GetId(), DISCOURAGEMENT_THRESHOLD, /* message */ "");
Expand Down

0 comments on commit faad92f

Please sign in to comment.