diff options
author | Zachary Michaels <mikezackles@gmail.com> | 2014-07-16 13:30:15 -0400 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2014-09-15 15:53:01 +0200 |
commit | 07470fd400ee30b84f6227edffb24094d03781cb (patch) | |
tree | 6399848a2020528971884f5f625d0a2403f92327 /src/p2p/net_node.inl | |
parent | increase ABSTRACT_SERVER_SEND_QUE_MAX_COUNT to a more sane value (diff) | |
download | monero-07470fd400ee30b84f6227edffb24094d03781cb.tar.xz |
Add testnet flag
Source: cryptonotefoundation
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r-- | src/p2p/net_node.inl | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index ee401ce42..211f5064a 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -224,19 +224,23 @@ namespace nodetool #define ADD_HARDCODED_SEED_NODE(addr) append_net_address(m_seed_nodes, addr); //----------------------------------------------------------------------------------- template<class t_payload_net_handler> - bool node_server<t_payload_net_handler>::init(const boost::program_options::variables_map& vm) + bool node_server<t_payload_net_handler>::init(const boost::program_options::variables_map& vm, bool testnet) { - ADD_HARDCODED_SEED_NODE("62.210.78.186:18080"); - ADD_HARDCODED_SEED_NODE("195.12.60.154:18080"); - ADD_HARDCODED_SEED_NODE("54.241.246.125:18080"); - ADD_HARDCODED_SEED_NODE("107.170.157.169:18080"); - ADD_HARDCODED_SEED_NODE("54.207.112.216:18080"); - ADD_HARDCODED_SEED_NODE("78.27.112.54:18080"); - ADD_HARDCODED_SEED_NODE("209.222.30.57:18080"); - ADD_HARDCODED_SEED_NODE("80.71.13.55:18080"); - ADD_HARDCODED_SEED_NODE("107.178.112.126:18080"); - ADD_HARDCODED_SEED_NODE("107.158.233.98:18080"); - ADD_HARDCODED_SEED_NODE("64.22.111.2:18080"); + if (!testnet) { + ADD_HARDCODED_SEED_NODE("62.210.78.186:18080"); + ADD_HARDCODED_SEED_NODE("195.12.60.154:18080"); + ADD_HARDCODED_SEED_NODE("54.241.246.125:18080"); + ADD_HARDCODED_SEED_NODE("107.170.157.169:18080"); + ADD_HARDCODED_SEED_NODE("54.207.112.216:18080"); + ADD_HARDCODED_SEED_NODE("78.27.112.54:18080"); + ADD_HARDCODED_SEED_NODE("209.222.30.57:18080"); + ADD_HARDCODED_SEED_NODE("80.71.13.55:18080"); + ADD_HARDCODED_SEED_NODE("107.178.112.126:18080"); + ADD_HARDCODED_SEED_NODE("107.158.233.98:18080"); + ADD_HARDCODED_SEED_NODE("64.22.111.2:18080"); + } else { + m_network_id.data[0] += 1; + } bool res = handle_command_line(vm); CHECK_AND_ASSERT_MES(res, false, "Failed to handle command line"); @@ -410,7 +414,7 @@ namespace nodetool return; } - if(rsp.node_data.network_id != MONERO_NETWORK) + if(rsp.node_data.network_id != m_network_id) { LOG_ERROR_CCONTEXT("COMMAND_HANDSHAKE Failed, wrong network! (" << epee::string_tools::get_str_from_guid_a(rsp.node_data.network_id) << "), closing connection."); return; @@ -818,7 +822,7 @@ namespace nodetool node_data.my_port = m_external_port ? m_external_port : m_listenning_port; else node_data.my_port = 0; - node_data.network_id = MONERO_NETWORK; + node_data.network_id = m_network_id; return true; } //----------------------------------------------------------------------------------- @@ -1038,7 +1042,7 @@ namespace nodetool template<class t_payload_net_handler> int node_server<t_payload_net_handler>::handle_handshake(int command, typename COMMAND_HANDSHAKE::request& arg, typename COMMAND_HANDSHAKE::response& rsp, p2p_connection_context& context) { - if(arg.node_data.network_id != MONERO_NETWORK) + if(arg.node_data.network_id != m_network_id) { LOG_PRINT_CCONTEXT_L1("WRONG NETWORK AGENT CONNECTED! id=" << epee::string_tools::get_str_from_guid_a(arg.node_data.network_id)); |