aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/core.h
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-12-17 12:59:43 +0200
committerRiccardo Spagni <ric@spagni.net>2017-12-17 12:59:44 +0200
commit066fd7aced8ff0079271bae1295355d741f2ea7b (patch)
treee8056ad1f87ed1d9fc695e68c87bb5adc2700d52 /src/daemon/core.h
parentMerge pull request #2864 (diff)
parentWallets now do not depend on the daemon rpc lib (diff)
downloadmonero-066fd7aced8ff0079271bae1295355d741f2ea7b.tar.xz
Merge pull request #2877
43f5269f Wallets now do not depend on the daemon rpc lib (moneromooo-monero) bb89ae8b move connection_basic and network_throttle from src/p2p to epee (moneromooo-monero) 4abf25f3 cryptonote_core does not depend on p2p anymore (moneromooo-monero)
Diffstat (limited to 'src/daemon/core.h')
-rw-r--r--src/daemon/core.h15
1 files changed, 14 insertions, 1 deletions
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;
}