| 42 | } |
| 43 | |
| 44 | std::vector<NodeEvictionCandidate> GetRandomNodeEvictionCandidates(int n_candidates, FastRandomContext& random_context) |
| 45 | { |
| 46 | std::vector<NodeEvictionCandidate> candidates; |
| 47 | for (int id = 0; id < n_candidates; ++id) { |
| 48 | candidates.push_back({ |
| 49 | /*id=*/id, |
| 50 | /*m_connected=*/std::chrono::seconds{random_context.randrange(100)}, |
| 51 | /*m_min_ping_time=*/std::chrono::microseconds{random_context.randrange(100)}, |
| 52 | /*m_last_block_time=*/std::chrono::seconds{random_context.randrange(100)}, |
| 53 | /*m_last_tx_time=*/std::chrono::seconds{random_context.randrange(100)}, |
| 54 | /*fRelevantServices=*/random_context.randbool(), |
| 55 | /*fRelayTxes=*/random_context.randbool(), |
| 56 | /*fBloomFilter=*/random_context.randbool(), |
| 57 | /*nKeyedNetGroup=*/random_context.randrange(100), |
| 58 | /*prefer_evict=*/random_context.randbool(), |
| 59 | /*m_is_local=*/random_context.randbool(), |
| 60 | /*m_network=*/ALL_NETWORKS[random_context.randrange(ALL_NETWORKS.size())], |
| 61 | }); |
| 62 | } |
| 63 | return candidates; |
| 64 | } |
no test coverage detected