p2p: remove blocked addresses/hosts from peerlist

This commit is contained in:
moneromooo-monero
2021-07-27 10:02:26 +00:00
parent de3456e127
commit 7354ffb8a7
5 changed files with 48 additions and 15 deletions
+2 -10
View File
@@ -289,17 +289,9 @@ namespace nodetool
copy_peers(peers.anchor, m_peers_anchor.get<by_addr>());
}
void peerlist_manager::evict_host_from_white_peerlist(const peerlist_entry& pr)
void peerlist_manager::evict_host_from_peerlist(bool use_white, const peerlist_entry& pr)
{
peers_indexed::index<by_time>::type& sorted_index=m_peers_white.get<by_time>();
auto i = sorted_index.begin();
while (i != sorted_index.end())
{
if (i->adr.is_same_host(pr.adr))
i = sorted_index.erase(i);
else
++i;
}
filter(use_white, [&pr](const peerlist_entry& pe){ return pe.adr.is_same_host(pr.adr); });
}
}