diff options
author | practicalswift <practicalswift@users.noreply.github.com> | 2020-09-18 12:47:08 +0000 |
---|---|---|
committer | practicalswift <practicalswift@users.noreply.github.com> | 2020-12-16 12:00:15 +0000 |
commit | ed73f8cee0d7b7facbd2e8dde24a237f20c48c0c (patch) | |
tree | b669f32eeaf503305d4dd78a1d6e497cfa82fe61 /src/net.h | |
parent | 00f4dcd5520e14529b5c3fa8e14feb3a023ffb4c (diff) | |
download | bitcoin-ed73f8cee0d7b7facbd2e8dde24a237f20c48c0c.tar.xz |
net: Move eviction node selection logic to SelectNodeToEvict(...)
Diffstat (limited to 'src/net.h')
-rw-r--r-- | src/net.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -33,6 +33,7 @@ #include <map> #include <memory> #include <thread> +#include <vector> class CScheduler; class CNode; @@ -1226,4 +1227,21 @@ inline std::chrono::microseconds PoissonNextSend(std::chrono::microseconds now, return std::chrono::microseconds{PoissonNextSend(now.count(), average_interval.count())}; } +struct NodeEvictionCandidate +{ + NodeId id; + int64_t nTimeConnected; + int64_t nMinPingUsecTime; + int64_t nLastBlockTime; + int64_t nLastTXTime; + bool fRelevantServices; + bool fRelayTxes; + bool fBloomFilter; + uint64_t nKeyedNetGroup; + bool prefer_evict; + bool m_is_local; +}; + +[[nodiscard]] Optional<NodeId> SelectNodeToEvict(std::vector<NodeEvictionCandidate>&& vEvictionCandidates); + #endif // BITCOIN_NET_H |