diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2021-07-27 10:02:26 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2021-08-05 17:29:25 +0000 |
commit | 7354ffb8a7ccdfab0c7be186423634ac571ba1cb (patch) | |
tree | dac627b8257bda98c2cdcd59c5d8e8068a2845a4 /src/p2p/net_peerlist.cpp | |
parent | Merge pull request #7764 (diff) | |
download | monero-7354ffb8a7ccdfab0c7be186423634ac571ba1cb.tar.xz |
p2p: remove blocked addresses/hosts from peerlist
Diffstat (limited to 'src/p2p/net_peerlist.cpp')
-rw-r--r-- | src/p2p/net_peerlist.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/p2p/net_peerlist.cpp b/src/p2p/net_peerlist.cpp index 42ab9727d..50dc6da77 100644 --- a/src/p2p/net_peerlist.cpp +++ b/src/p2p/net_peerlist.cpp @@ -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); }); } } |