aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_peerlist.h
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-12-07 10:07:33 -0600
committerluigi1111 <luigi1111w@gmail.com>2020-12-07 10:07:33 -0600
commit3d2a50a5c035d59c804740229bb0829ad04845ee (patch)
treecee83a87f7e754c0369e032104945f2a04d7b9b0 /src/p2p/net_peerlist.h
parentMerge pull request #7068 (diff)
parentprotocol: drop peers that don't reply to queries (diff)
downloadmonero-3d2a50a5c035d59c804740229bb0829ad04845ee.tar.xz
Merge pull request #7055
ff7fdf6 protocol: drop peers that don't reply to queries (moneromooo-monero) 89e984d keep only the last seen node on a given host in the white list (moneromooo-monero) c74d8ff protocol: drop peers that decrease claimed height (moneromooo-monero) 61f5001 protocol: add scoring system to drop peers that don't behave (moneromooo-monero)
Diffstat (limited to 'src/p2p/net_peerlist.h')
-rw-r--r--src/p2p/net_peerlist.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/p2p/net_peerlist.h b/src/p2p/net_peerlist.h
index 992462d0b..c794b0f3b 100644
--- a/src/p2p/net_peerlist.h
+++ b/src/p2p/net_peerlist.h
@@ -109,6 +109,7 @@ namespace nodetool
bool get_white_peer_by_index(peerlist_entry& p, size_t i);
bool get_gray_peer_by_index(peerlist_entry& p, size_t i);
template<typename F> bool foreach(bool white, const F &f);
+ void evict_host_from_white_peerlist(const peerlist_entry& pr);
bool append_with_peer_white(const peerlist_entry& pr);
bool append_with_peer_gray(const peerlist_entry& pr);
bool append_with_peer_anchor(const anchor_peerlist_entry& ple);
@@ -345,6 +346,7 @@ namespace nodetool
if(by_addr_it_wt == m_peers_white.get<by_addr>().end())
{
//put new record into white list
+ evict_host_from_white_peerlist(ple);
m_peers_white.insert(ple);
trim_white_peerlist();
}else