Skip to content

Commit 045cb40

Browse files
committed
p2p: remove unused m_is_onion member from NodeEvictionCandidate struct
1 parent 310fab4 commit 045cb40

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ bool CConnman::AttemptToEvictConnection()
10631063
HasAllDesirableServiceFlags(node->nServices),
10641064
peer_relay_txes, peer_filter_not_null, node->nKeyedNetGroup,
10651065
node->m_prefer_evict, node->addr.IsLocal(),
1066-
node->m_inbound_onion, node->ConnectedThroughNetwork()};
1066+
node->ConnectedThroughNetwork()};
10671067
vEvictionCandidates.push_back(candidate);
10681068
}
10691069
}

src/net.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,6 @@ struct NodeEvictionCandidate
12091209
uint64_t nKeyedNetGroup;
12101210
bool prefer_evict;
12111211
bool m_is_local;
1212-
bool m_is_onion;
12131212
Network m_network;
12141213
};
12151214

src/test/fuzz/node_eviction.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ FUZZ_TARGET(node_eviction)
3131
/* nKeyedNetGroup */ fuzzed_data_provider.ConsumeIntegral<uint64_t>(),
3232
/* prefer_evict */ fuzzed_data_provider.ConsumeBool(),
3333
/* m_is_local */ fuzzed_data_provider.ConsumeBool(),
34-
/* m_is_onion */ fuzzed_data_provider.ConsumeBool(),
3534
/* m_network */ fuzzed_data_provider.PickValueInArray(ALL_NETWORKS),
3635
});
3736
}

src/test/net_peer_eviction_tests.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ std::vector<NodeEvictionCandidate> GetRandomNodeEvictionCandidates(const int n_c
3333
/* nKeyedNetGroup */ random_context.randrange(100),
3434
/* prefer_evict */ random_context.randbool(),
3535
/* m_is_local */ random_context.randbool(),
36-
/* m_is_onion */ random_context.randbool(),
3736
/* m_network */ ALL_NETWORKS[random_context.randrange(ALL_NETWORKS.size())],
3837
});
3938
}
@@ -92,7 +91,7 @@ BOOST_AUTO_TEST_CASE(peer_protection_test)
9291
BOOST_CHECK(IsProtected(
9392
num_peers, [](NodeEvictionCandidate& c) {
9493
c.nTimeConnected = c.id;
95-
c.m_is_onion = c.m_is_local = false;
94+
c.m_is_local = false;
9695
c.m_network = NET_IPV4;
9796
},
9897
/* protected_peer_ids */ {0, 1, 2, 3, 4, 5},
@@ -103,7 +102,7 @@ BOOST_AUTO_TEST_CASE(peer_protection_test)
103102
BOOST_CHECK(IsProtected(
104103
num_peers, [num_peers](NodeEvictionCandidate& c) {
105104
c.nTimeConnected = num_peers - c.id;
106-
c.m_is_onion = c.m_is_local = false;
105+
c.m_is_local = false;
107106
c.m_network = NET_IPV6;
108107
},
109108
/* protected_peer_ids */ {6, 7, 8, 9, 10, 11},
@@ -139,7 +138,6 @@ BOOST_AUTO_TEST_CASE(peer_protection_test)
139138
// if no onion peers.
140139
BOOST_CHECK(IsProtected(
141140
num_peers, [](NodeEvictionCandidate& c) {
142-
c.m_is_onion = false;
143141
c.m_is_local = (c.id == 1 || c.id == 9 || c.id == 11);
144142
c.m_network = NET_IPV4;
145143
},
@@ -152,7 +150,6 @@ BOOST_AUTO_TEST_CASE(peer_protection_test)
152150
BOOST_CHECK(IsProtected(
153151
num_peers, [](NodeEvictionCandidate& c) {
154152
c.nTimeConnected = c.id;
155-
c.m_is_onion = false;
156153
c.m_is_local = (c.id > 6);
157154
c.m_network = NET_IPV6;
158155
},

0 commit comments

Comments
 (0)