aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorpracticalswift <practicalswift@users.noreply.github.com>2020-09-18 12:47:08 +0000
committerpracticalswift <practicalswift@users.noreply.github.com>2020-12-16 12:00:15 +0000
commited73f8cee0d7b7facbd2e8dde24a237f20c48c0c (patch)
treeb669f32eeaf503305d4dd78a1d6e497cfa82fe61 /src/net.h
parent00f4dcd5520e14529b5c3fa8e14feb3a023ffb4c (diff)
downloadbitcoin-ed73f8cee0d7b7facbd2e8dde24a237f20c48c0c.tar.xz
net: Move eviction node selection logic to SelectNodeToEvict(...)
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index 77aaaac5b1..291f3887dd 100644
--- a/src/net.h
+++ b/src/net.h
@@ -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