diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-12-13 12:02:10 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-12-13 12:32:09 +0100 |
commit | fad7ead146a152f46b25ce6623e05cbb1dbc8cca (patch) | |
tree | 3eb7c696b2d23d76dda3b6b95e819efc9e826d80 /src/bench/peer_eviction.cpp | |
parent | eb63b8fab91c3aec46ef4ae66e6241ed5de49bbd (diff) | |
download | bitcoin-fad7ead146a152f46b25ce6623e05cbb1dbc8cca.tar.xz |
refactor: Use type-safe std::chrono in net
Diffstat (limited to 'src/bench/peer_eviction.cpp')
-rw-r--r-- | src/bench/peer_eviction.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/bench/peer_eviction.cpp b/src/bench/peer_eviction.cpp index 8429f18613..3eb9642f30 100644 --- a/src/bench/peer_eviction.cpp +++ b/src/bench/peer_eviction.cpp @@ -42,7 +42,7 @@ static void EvictionProtection0Networks250Candidates(benchmark::Bench& bench) bench, 250 /* num_candidates */, [](NodeEvictionCandidate& c) { - c.nTimeConnected = c.id; + c.nTimeConnected = std::chrono::seconds{c.id}; c.m_network = NET_IPV4; }); } @@ -53,7 +53,7 @@ static void EvictionProtection1Networks250Candidates(benchmark::Bench& bench) bench, 250 /* num_candidates */, [](NodeEvictionCandidate& c) { - c.nTimeConnected = c.id; + c.nTimeConnected = std::chrono::seconds{c.id}; c.m_is_local = false; if (c.id >= 130 && c.id < 240) { // 110 Tor c.m_network = NET_ONION; @@ -69,7 +69,7 @@ static void EvictionProtection2Networks250Candidates(benchmark::Bench& bench) bench, 250 /* num_candidates */, [](NodeEvictionCandidate& c) { - c.nTimeConnected = c.id; + c.nTimeConnected = std::chrono::seconds{c.id}; c.m_is_local = false; if (c.id >= 90 && c.id < 160) { // 70 Tor c.m_network = NET_ONION; @@ -87,7 +87,7 @@ static void EvictionProtection3Networks050Candidates(benchmark::Bench& bench) bench, 50 /* num_candidates */, [](NodeEvictionCandidate& c) { - c.nTimeConnected = c.id; + c.nTimeConnected = std::chrono::seconds{c.id}; c.m_is_local = (c.id == 28 || c.id == 47); // 2 localhost if (c.id >= 30 && c.id < 47) { // 17 I2P c.m_network = NET_I2P; @@ -105,7 +105,7 @@ static void EvictionProtection3Networks100Candidates(benchmark::Bench& bench) bench, 100 /* num_candidates */, [](NodeEvictionCandidate& c) { - c.nTimeConnected = c.id; + c.nTimeConnected = std::chrono::seconds{c.id}; c.m_is_local = (c.id >= 55 && c.id < 60); // 5 localhost if (c.id >= 70 && c.id < 80) { // 10 I2P c.m_network = NET_I2P; @@ -123,7 +123,7 @@ static void EvictionProtection3Networks250Candidates(benchmark::Bench& bench) bench, 250 /* num_candidates */, [](NodeEvictionCandidate& c) { - c.nTimeConnected = c.id; + c.nTimeConnected = std::chrono::seconds{c.id}; c.m_is_local = (c.id >= 140 && c.id < 160); // 20 localhost if (c.id >= 170 && c.id < 180) { // 10 I2P c.m_network = NET_I2P; |