Changeset View
Changeset View
Standalone View
Standalone View
src/test/net_tests.cpp
Show First 20 Lines • Show All 911 Lines • ▼ Show 20 Lines | for (int i = 0; i < NODE_EVICTION_TEST_ROUNDS; ++i) { | ||||
BOOST_CHECK(!IsEvicted( | BOOST_CHECK(!IsEvicted( | ||||
number_of_nodes, | number_of_nodes, | ||||
[number_of_nodes](NodeEvictionCandidate &candidate) { | [number_of_nodes](NodeEvictionCandidate &candidate) { | ||||
candidate.nKeyedNetGroup = | candidate.nKeyedNetGroup = | ||||
number_of_nodes - candidate.id; // 4 protected | number_of_nodes - candidate.id; // 4 protected | ||||
candidate.nMinPingUsecTime = candidate.id; // 8 protected | candidate.nMinPingUsecTime = candidate.id; // 8 protected | ||||
candidate.nLastTXTime = | candidate.nLastTXTime = | ||||
number_of_nodes - candidate.id; // 4 protected | number_of_nodes - candidate.id; // 4 protected | ||||
candidate.nLastProofTime = | |||||
number_of_nodes - candidate.id; // 4 protected | |||||
candidate.nLastBlockTime = | candidate.nLastBlockTime = | ||||
number_of_nodes - candidate.id; // 4 protected | number_of_nodes - candidate.id; // 4 protected | ||||
}, | }, | ||||
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, | {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, | ||||
10, 11, 12, 13, 14, 15, 16, 17, 18, 19}, | 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}, | ||||
random_context)); | random_context)); | ||||
// An eviction is expected given >= 33 random eviction candidates. | // An eviction is expected given >= 33 random eviction candidates. | ||||
// The eviction logic protects at most four peers by net group, | // The eviction logic protects at most four peers by net group, | ||||
// eight by lowest ping time, four by last time of novel tx, four by | // eight by lowest ping time, four by last time of novel tx, four by | ||||
// last time of novel proof, up to eight non-tx-relay peers by last | // last time of novel proof, up to eight non-tx-relay peers by last | ||||
// novel block time, and four more peers by last novel block time. | // novel block time, and four more peers by last novel block time. | ||||
if (number_of_nodes >= 33) { | if (number_of_nodes >= 33) { | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |