Revert "allow sync over tor"

master
jw 4 years ago committed by GitHub
parent ed16ffcb4e
commit acab673a6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -345,9 +345,7 @@ namespace cryptonote
}
// No chain synchronization over hidden networks (tor, i2p, etc.)
// if(context.m_remote_address.get_zone() != epee::net_utils::zone::public_)
// wow wow wow ...
if (false)
if(context.m_remote_address.get_zone() != epee::net_utils::zone::public_)
{
context.m_state = cryptonote_connection_context::state_normal;
return true;
@ -2386,7 +2384,7 @@ skip:
std::vector<std::pair<epee::net_utils::zone, boost::uuids::uuid>> fullConnections, fluffyConnections;
m_p2p->for_each_connection([this, &exclude_context, &fullConnections, &fluffyConnections](connection_context& context, nodetool::peerid_type peer_id, uint32_t support_flags)
{
if (peer_id && exclude_context.m_connection_id != context.m_connection_id)
if (peer_id && exclude_context.m_connection_id != context.m_connection_id && context.m_remote_address.get_zone() == epee::net_utils::zone::public_)
{
if(m_core.fluffy_blocks_enabled() && (support_flags & P2P_SUPPORT_FLAG_FLUFFY_BLOCKS))
{

@ -313,8 +313,7 @@ namespace nodetool
break;
}
// nice try
// if (address.get_zone() == epee::net_utils::zone::public_)
if (address.get_zone() == epee::net_utils::zone::public_)
return false;
MWARNING("Filtered command (#" << command << ") to/from " << address.str());

@ -135,7 +135,6 @@ namespace nodetool
m_peerlist_storage = std::move(*storage);
m_network_zones[epee::net_utils::zone::public_].m_config.m_support_flags = P2P_SUPPORT_FLAGS;
m_network_zones[epee::net_utils::zone::tor].m_config.m_support_flags = P2P_SUPPORT_FLAGS;
m_first_connection_maker_call = true;
CATCH_ENTRY_L0("node_server::init_config", false);
@ -2161,8 +2160,8 @@ namespace nodetool
template<class t_payload_net_handler>
bool node_server<t_payload_net_handler>::try_get_support_flags(const p2p_connection_context& context, std::function<void(p2p_connection_context&, const uint32_t&)> f)
{
// if(context.m_remote_address.get_zone() != epee::net_utils::zone::public_)
// return false;
if(context.m_remote_address.get_zone() != epee::net_utils::zone::public_)
return false;
COMMAND_REQUEST_SUPPORT_FLAGS::request support_flags_request;
bool r = epee::net_utils::async_invoke_remote_command2<typename COMMAND_REQUEST_SUPPORT_FLAGS::response>

Loading…
Cancel
Save