diff options
author | Thomas Winget <tewinget@gmail.com> | 2015-01-29 17:10:53 -0500 |
---|---|---|
committer | Thomas Winget <tewinget@gmail.com> | 2015-02-24 00:05:19 -0500 |
commit | 9193d6fb5be92df732af18b08b1e052f84cc2f9d (patch) | |
tree | dfe58f501122beec786322d30d04efacf8c90259 /src/p2p | |
parent | Merge pull request #221 (diff) | |
download | monero-9193d6fb5be92df732af18b08b1e052f84cc2f9d.tar.xz |
Daemonize changes pulled in -- daemon builds
many RPC functions added by the daemonize changes
(and related changes on the upstream dev branch that were not merged)
were commented out (apart from return). Other than that, this *should*
work...at any rate, it builds, and that's something.
Diffstat (limited to 'src/p2p')
-rw-r--r-- | src/p2p/net_node.h | 4 | ||||
-rw-r--r-- | src/p2p/net_node.inl | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/p2p/net_node.h b/src/p2p/net_node.h index 97fcd56c8..a778cd9e8 100644 --- a/src/p2p/net_node.h +++ b/src/p2p/net_node.h @@ -82,18 +82,16 @@ namespace nodetool node_server( t_payload_net_handler& payload_handler - , boost::uuids::uuid network_id ) : m_payload_handler(payload_handler) , m_allow_local_ip(false) , m_hide_my_port(false) - , m_network_id(std::move(network_id)) {} static void init_options(boost::program_options::options_description& desc); bool run(); - bool init(const boost::program_options::variables_map& vm, bool testnet); + bool init(const boost::program_options::variables_map& vm); bool deinit(); bool send_stop_signal(); uint32_t get_this_peer_port(){return m_listenning_port;} diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index ee4a10789..6ed861e10 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -46,6 +46,7 @@ #include "net/local_ip.h" #include "crypto/crypto.h" #include "storages/levin_abstract_invoke2.h" +#include "daemon/command_line_args.h" // We have to look for miniupnpc headers in different places, dependent on if its compiled or external #ifdef UPNP_STATIC @@ -241,16 +242,20 @@ namespace nodetool //----------------------------------------------------------------------------------- template<class t_payload_net_handler> - bool node_server<t_payload_net_handler>::init(const boost::program_options::variables_map& vm, bool testnet) + bool node_server<t_payload_net_handler>::init(const boost::program_options::variables_map& vm) { + bool testnet = command_line::get_arg(vm, daemon_args::arg_testnet_on); + if (testnet) { + memcpy(&m_network_id, &::config::testnet::NETWORK_ID, 16); append_net_address(m_seed_nodes, "107.152.187.202:28080"); append_net_address(m_seed_nodes, "197.242.158.240:28080"); append_net_address(m_seed_nodes, "107.152.130.98:28080"); } else { + memcpy(&m_network_id, &::config::NETWORK_ID, 16); // 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 |