aboutsummaryrefslogtreecommitdiff
path: root/src/p2p
diff options
context:
space:
mode:
Diffstat (limited to 'src/p2p')
-rw-r--r--src/p2p/net_node.h7
-rw-r--r--src/p2p/net_node.inl38
2 files changed, 34 insertions, 11 deletions
diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h
index 759b21fcf..53a13f327 100644
--- a/src/p2p/net_node.h
+++ b/src/p2p/net_node.h
@@ -112,6 +112,13 @@ namespace nodetool
size_t get_outgoing_connections_count();
peerlist_manager& get_peerlist_manager(){return m_peerlist;}
private:
+ const std::vector<std::string> m_seed_nodes_list =
+ { "seeds.moneroseeds.se"
+ , "seeds.moneroseeds.ae.org"
+ , "seeds.moneroseeds.ch"
+ , "seeds.moneroseeds.li"
+ };
+
typedef COMMAND_REQUEST_STAT_INFO_T<typename t_payload_net_handler::stat_info> COMMAND_REQUEST_STAT_INFO;
CHAIN_LEVIN_INVOKE_MAP2(p2p_connection_context); //move levin_commands_handler interface invoke(...) callbacks into invoke map
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 954d794b7..60bc870e7 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -245,17 +245,33 @@ namespace nodetool
}
else
{
- add_hardcoded_seed_node(m_seed_nodes, "62.210.78.186:18080");
- add_hardcoded_seed_node(m_seed_nodes, "195.12.60.154:18080");
- add_hardcoded_seed_node(m_seed_nodes, "54.241.246.125:18080");
- add_hardcoded_seed_node(m_seed_nodes, "107.170.157.169:18080");
- add_hardcoded_seed_node(m_seed_nodes, "54.207.112.216:18080");
- add_hardcoded_seed_node(m_seed_nodes, "78.27.112.54:18080");
- add_hardcoded_seed_node(m_seed_nodes, "209.222.30.57:18080");
- add_hardcoded_seed_node(m_seed_nodes, "80.71.13.55:18080");
- add_hardcoded_seed_node(m_seed_nodes, "107.178.112.126:18080");
- add_hardcoded_seed_node(m_seed_nodes, "107.158.233.98:18080");
- add_hardcoded_seed_node(m_seed_nodes, "64.22.111.2:18080");
+ // for each hostname in the seed nodes list, attempt to DNS resolve and
+ // add the result addresses as seed nodes
+ // TODO: at some point add IPv6 support, but that won't be relevant
+ // for some time yet.
+ for (const std::string& addr_str : m_seed_nodes_list)
+ {
+ std::vector<std::string> addr_list = tools::DNSResolver::instance().get_ipv4(addr_str);
+ for (const std::string& a : addr_list)
+ {
+ append_net_address(m_seed_nodes, a + ":18080");
+ }
+ }
+
+ if (!m_seed_nodes.size())
+ {
+ add_hardcoded_seed_node(m_seed_nodes, "62.210.78.186:18080");
+ add_hardcoded_seed_node(m_seed_nodes, "195.12.60.154:18080");
+ add_hardcoded_seed_node(m_seed_nodes, "54.241.246.125:18080");
+ add_hardcoded_seed_node(m_seed_nodes, "107.170.157.169:18080");
+ add_hardcoded_seed_node(m_seed_nodes, "54.207.112.216:18080");
+ add_hardcoded_seed_node(m_seed_nodes, "78.27.112.54:18080");
+ add_hardcoded_seed_node(m_seed_nodes, "209.222.30.57:18080");
+ add_hardcoded_seed_node(m_seed_nodes, "80.71.13.55:18080");
+ add_hardcoded_seed_node(m_seed_nodes, "107.178.112.126:18080");
+ add_hardcoded_seed_node(m_seed_nodes, "107.158.233.98:18080");
+ add_hardcoded_seed_node(m_seed_nodes, "64.22.111.2:18080");
+ }
}
bool res = handle_command_line(vm, testnet);