diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-11-29 22:53:58 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-12-16 23:28:38 +0000 |
commit | 4abf25f3c901016803515771cc19997d9a95bacb (patch) | |
tree | d50394f78de54d35af9970c67631dc2a9b63914a /src/daemon | |
parent | Merge pull request #2881 (diff) | |
download | monero-4abf25f3c901016803515771cc19997d9a95bacb.tar.xz |
cryptonote_core does not depend on p2p anymore
As a followon side effect, this makes a lot of inline code
included only in particular cpp files (and instanciated
when necessary.
Diffstat (limited to 'src/daemon')
-rw-r--r-- | src/daemon/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/daemon/core.h | 15 | ||||
-rw-r--r-- | src/daemon/main.cpp | 1 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt index 2f9c2b2f9..298965e10 100644 --- a/src/daemon/CMakeLists.txt +++ b/src/daemon/CMakeLists.txt @@ -67,7 +67,6 @@ set(daemon_private_headers # p2p ../p2p/net_node.h - ../p2p/net_node.inl ../p2p/net_node_common.h ../p2p/net_peerlist.h ../p2p/net_peerlist_boost_serialization.h diff --git a/src/daemon/core.h b/src/daemon/core.h index 9e6ff5e29..97f1cb8c1 100644 --- a/src/daemon/core.h +++ b/src/daemon/core.h @@ -67,11 +67,24 @@ public: m_core.set_cryptonote_protocol(&protocol); } + std::string get_config_subdir() const + { + bool testnet = command_line::get_arg(m_vm_HACK, cryptonote::arg_testnet_on); + auto p2p_bind_arg = testnet ? nodetool::arg_testnet_p2p_bind_port : nodetool::arg_p2p_bind_port; + std::string port = command_line::get_arg(m_vm_HACK, p2p_bind_arg); + if ((!testnet && port != std::to_string(::config::P2P_DEFAULT_PORT)) + || (testnet && port != std::to_string(::config::testnet::P2P_DEFAULT_PORT))) { + return port; + } + return std::string(); + } + bool run() { //initialize core here MGINFO("Initializing core..."); - if (!m_core.init(m_vm_HACK)) + std::string config_subdir = get_config_subdir(); + if (!m_core.init(m_vm_HACK, config_subdir.empty() ? NULL : config_subdir.c_str())) { return false; } diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index d038cc825..6ac47fcb2 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -44,6 +44,7 @@ #include "rpc/rpc_args.h" #include "daemon/command_line_args.h" #include "blockchain_db/db_types.h" +#include "version.h" #ifdef STACK_TRACE #include "common/stack_trace.h" |