|
|
|
@ -1262,7 +1262,7 @@ namespace nodetool
|
|
|
|
|
bool is_priority = is_priority_node(na);
|
|
|
|
|
LOG_PRINT_CC_PRIORITY_NODE(is_priority, bool(con), "Connect failed to " << na.str()
|
|
|
|
|
/*<< ", try " << try_count*/);
|
|
|
|
|
//m_peerlist.set_peer_unreachable(pe);
|
|
|
|
|
record_addr_failed(na);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1277,6 +1277,7 @@ namespace nodetool
|
|
|
|
|
<< na.str()
|
|
|
|
|
/*<< ", try " << try_count*/);
|
|
|
|
|
zone.m_net_server.get_config_object().close(con->m_connection_id);
|
|
|
|
|
record_addr_failed(na);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1327,6 +1328,7 @@ namespace nodetool
|
|
|
|
|
bool is_priority = is_priority_node(na);
|
|
|
|
|
|
|
|
|
|
LOG_PRINT_CC_PRIORITY_NODE(is_priority, p2p_connection_context{}, "Connect failed to " << na.str());
|
|
|
|
|
record_addr_failed(na);
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -1339,6 +1341,7 @@ namespace nodetool
|
|
|
|
|
|
|
|
|
|
LOG_PRINT_CC_PRIORITY_NODE(is_priority, *con, "Failed to HANDSHAKE with peer " << na.str());
|
|
|
|
|
zone.m_net_server.get_config_object().close(con->m_connection_id);
|
|
|
|
|
record_addr_failed(na);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1351,6 +1354,13 @@ namespace nodetool
|
|
|
|
|
|
|
|
|
|
#undef LOG_PRINT_CC_PRIORITY_NODE
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------------
|
|
|
|
|
template<class t_payload_net_handler>
|
|
|
|
|
void node_server<t_payload_net_handler>::record_addr_failed(const epee::net_utils::network_address& addr)
|
|
|
|
|
{
|
|
|
|
|
CRITICAL_REGION_LOCAL(m_conn_fails_cache_lock);
|
|
|
|
|
m_conn_fails_cache[addr.host_str()] = time(NULL);
|
|
|
|
|
}
|
|
|
|
|
//-----------------------------------------------------------------------------------
|
|
|
|
|
template<class t_payload_net_handler>
|
|
|
|
|
bool node_server<t_payload_net_handler>::is_addr_recently_failed(const epee::net_utils::network_address& addr)
|
|
|
|
@ -1912,7 +1922,7 @@ namespace nodetool
|
|
|
|
|
|
|
|
|
|
LOG_DEBUG_CC(context, "REMOTE PEERLIST: remote peerlist size=" << peerlist_.size());
|
|
|
|
|
LOG_TRACE_CC(context, "REMOTE PEERLIST: " << ENDL << print_peerlist_to_string(peerlist_));
|
|
|
|
|
return m_network_zones.at(context.m_remote_address.get_zone()).m_peerlist.merge_peerlist(peerlist_);
|
|
|
|
|
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); });
|
|
|
|
|
}
|
|
|
|
|
//-----------------------------------------------------------------------------------
|
|
|
|
|
template<class t_payload_net_handler>
|
|
|
|
|