mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-29 23:33:33 +02:00
refactor: Use NodeClock::time_point for m_connected
Also, increase the precision to the native one, over prescribing second precision.
This commit is contained in:
@@ -41,7 +41,7 @@ static void EvictionProtection0Networks250Candidates(benchmark::Bench& bench)
|
||||
bench,
|
||||
/*num_candidates=*/250,
|
||||
[](NodeEvictionCandidate& c) {
|
||||
c.m_connected = std::chrono::seconds{c.id};
|
||||
c.m_connected = NodeSeconds{std::chrono::seconds{c.id}};
|
||||
c.m_network = NET_IPV4;
|
||||
});
|
||||
}
|
||||
@@ -52,7 +52,7 @@ static void EvictionProtection1Networks250Candidates(benchmark::Bench& bench)
|
||||
bench,
|
||||
/*num_candidates=*/250,
|
||||
[](NodeEvictionCandidate& c) {
|
||||
c.m_connected = std::chrono::seconds{c.id};
|
||||
c.m_connected = NodeSeconds{std::chrono::seconds{c.id}};
|
||||
c.m_is_local = false;
|
||||
if (c.id >= 130 && c.id < 240) { // 110 Tor
|
||||
c.m_network = NET_ONION;
|
||||
@@ -68,7 +68,7 @@ static void EvictionProtection2Networks250Candidates(benchmark::Bench& bench)
|
||||
bench,
|
||||
/*num_candidates=*/250,
|
||||
[](NodeEvictionCandidate& c) {
|
||||
c.m_connected = std::chrono::seconds{c.id};
|
||||
c.m_connected = NodeSeconds{std::chrono::seconds{c.id}};
|
||||
c.m_is_local = false;
|
||||
if (c.id >= 90 && c.id < 160) { // 70 Tor
|
||||
c.m_network = NET_ONION;
|
||||
@@ -86,7 +86,7 @@ static void EvictionProtection3Networks050Candidates(benchmark::Bench& bench)
|
||||
bench,
|
||||
/*num_candidates=*/50,
|
||||
[](NodeEvictionCandidate& c) {
|
||||
c.m_connected = std::chrono::seconds{c.id};
|
||||
c.m_connected = NodeSeconds{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;
|
||||
@@ -104,7 +104,7 @@ static void EvictionProtection3Networks100Candidates(benchmark::Bench& bench)
|
||||
bench,
|
||||
/*num_candidates=*/100,
|
||||
[](NodeEvictionCandidate& c) {
|
||||
c.m_connected = std::chrono::seconds{c.id};
|
||||
c.m_connected = NodeSeconds{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;
|
||||
@@ -122,7 +122,7 @@ static void EvictionProtection3Networks250Candidates(benchmark::Bench& bench)
|
||||
bench,
|
||||
/*num_candidates=*/250,
|
||||
[](NodeEvictionCandidate& c) {
|
||||
c.m_connected = std::chrono::seconds{c.id};
|
||||
c.m_connected = NodeSeconds{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;
|
||||
|
||||
Reference in New Issue
Block a user