From 89e984d93bac087e3a84013fc006690177cdad5f Mon Sep 17 00:00:00 2001 From: moneromooo Date: Wed, 2 Dec 2020 19:36:08 +0000 Subject: keep only the last seen node on a given host in the white list --- src/p2p/net_peerlist.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/p2p/net_peerlist.h') 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 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().end()) { //put new record into white list + evict_host_from_white_peerlist(ple); m_peers_white.insert(ple); trim_white_peerlist(); }else -- cgit v1.2.3