diff options
author | Miguel Herranz <miguel@ipglider.org> | 2017-01-21 00:59:04 +0100 |
---|---|---|
committer | Miguel Herranz <miguel@ipglider.org> | 2017-01-21 10:09:38 +0100 |
commit | 82dbeedd1bb92a6db31b2e887fee59b4382dc582 (patch) | |
tree | 4d14d35ae9a31bc2449a93ec458f509c75fd4193 /src/p2p/net_node.h | |
parent | Merge pull request #1599 (diff) | |
download | monero-82dbeedd1bb92a6db31b2e887fee59b4382dc582.tar.xz |
Add gray peer list housekeeping system
A random peer from the gray peer list is selected and a connection is
made to check if the peer is alive.
If the connection and handshake are successful the peer is promoted to
the white peer list, in case of failure the peer is evicted from the
gray peer list.
The connection is closed after the check in either case.
Diffstat (limited to 'src/p2p/net_node.h')
-rw-r--r-- | src/p2p/net_node.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h index 3f5a5ad93..f5309b1c3 100644 --- a/src/p2p/net_node.h +++ b/src/p2p/net_node.h @@ -229,6 +229,9 @@ namespace nodetool bool has_too_many_connections(const uint32_t ip); + bool check_connection_and_handshake_with_peer(const net_address& na, uint64_t last_seen_stamp); + bool gray_peerlist_housekeeping(); + void kill() { ///< will be called e.g. from deinit() _info("Killing the net_node"); is_closing = true; @@ -289,6 +292,7 @@ namespace nodetool epee::math_helper::once_a_time_seconds<P2P_DEFAULT_HANDSHAKE_INTERVAL> m_peer_handshake_idle_maker_interval; epee::math_helper::once_a_time_seconds<1> m_connections_maker_interval; epee::math_helper::once_a_time_seconds<60*30, false> m_peerlist_store_interval; + epee::math_helper::once_a_time_seconds<60> m_gray_peerlist_housekeeping_interval; std::string m_bind_ip; std::string m_port; |