p2p: fix deadlock banning while updating peer lists

This commit is contained in:
moneromooo 2020-12-31 02:05:39 +00:00 committed by moneromooo-monero
parent a1eca8ca7e
commit 656b2f7ce1
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3

View file

@ -2149,6 +2149,7 @@ namespace nodetool
LOG_DEBUG_CC(context, "REMOTE PEERLIST: remote peerlist size=" << peerlist_.size()); LOG_DEBUG_CC(context, "REMOTE PEERLIST: remote peerlist size=" << peerlist_.size());
LOG_TRACE_CC(context, "REMOTE PEERLIST: " << ENDL << print_peerlist_to_string(peerlist_)); LOG_TRACE_CC(context, "REMOTE PEERLIST: " << ENDL << print_peerlist_to_string(peerlist_));
CRITICAL_REGION_LOCAL(m_blocked_hosts_lock);
return m_network_zones.at(context.m_remote_address.get_zone()).m_peerlist.merge_peerlist(peerlist_, [this](const peerlist_entry &pe) { return m_network_zones.at(context.m_remote_address.get_zone()).m_peerlist.merge_peerlist(peerlist_, [this](const peerlist_entry &pe) {
return !is_addr_recently_failed(pe.adr) && is_remote_host_allowed(pe.adr); return !is_addr_recently_failed(pe.adr) && is_remote_host_allowed(pe.adr);
}); });