mirror of
https://github.com/monero-project/monero.git
synced 2024-10-01 11:49:47 -04:00
Merge pull request #1641
ca94d0a4
Separate data per P2P port (Miguel Herranz)
This commit is contained in:
commit
fcb299b4ae
@ -41,6 +41,7 @@ using namespace epee;
|
|||||||
#include "cryptonote_format_utils.h"
|
#include "cryptonote_format_utils.h"
|
||||||
#include "misc_language.h"
|
#include "misc_language.h"
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
#include <p2p/net_node.h>
|
||||||
#include "cryptonote_core/checkpoints.h"
|
#include "cryptonote_core/checkpoints.h"
|
||||||
#include "ringct/rctTypes.h"
|
#include "ringct/rctTypes.h"
|
||||||
#include "blockchain_db/blockchain_db.h"
|
#include "blockchain_db/blockchain_db.h"
|
||||||
@ -258,8 +259,17 @@ namespace cryptonote
|
|||||||
|
|
||||||
m_fakechain = test_options != NULL;
|
m_fakechain = test_options != NULL;
|
||||||
bool r = handle_command_line(vm);
|
bool r = handle_command_line(vm);
|
||||||
|
bool testnet = command_line::get_arg(vm, command_line::arg_testnet_on);
|
||||||
|
auto p2p_bind_arg = testnet ? nodetool::arg_testnet_p2p_bind_port : nodetool::arg_p2p_bind_port;
|
||||||
|
std::string m_port = command_line::get_arg(vm, p2p_bind_arg);
|
||||||
|
std::string m_config_folder_mempool = m_config_folder;
|
||||||
|
|
||||||
r = m_mempool.init(m_fakechain ? std::string() : m_config_folder);
|
if ((!testnet && m_port != std::to_string(::config::P2P_DEFAULT_PORT))
|
||||||
|
|| (testnet && m_port != std::to_string(::config::testnet::P2P_DEFAULT_PORT))) {
|
||||||
|
m_config_folder_mempool = m_config_folder_mempool + "/" + m_port;
|
||||||
|
}
|
||||||
|
|
||||||
|
r = m_mempool.init(m_fakechain ? std::string() : m_config_folder_mempool);
|
||||||
CHECK_AND_ASSERT_MES(r, false, "Failed to initialize memory pool");
|
CHECK_AND_ASSERT_MES(r, false, "Failed to initialize memory pool");
|
||||||
|
|
||||||
std::string db_type = command_line::get_arg(vm, command_line::arg_db_type);
|
std::string db_type = command_line::get_arg(vm, command_line::arg_db_type);
|
||||||
|
@ -505,6 +505,11 @@ namespace nodetool
|
|||||||
auto config_arg = testnet ? command_line::arg_testnet_data_dir : command_line::arg_data_dir;
|
auto config_arg = testnet ? command_line::arg_testnet_data_dir : command_line::arg_data_dir;
|
||||||
m_config_folder = command_line::get_arg(vm, config_arg);
|
m_config_folder = command_line::get_arg(vm, config_arg);
|
||||||
|
|
||||||
|
if ((!testnet && m_port != std::to_string(::config::P2P_DEFAULT_PORT))
|
||||||
|
|| (testnet && m_port != std::to_string(::config::testnet::P2P_DEFAULT_PORT))) {
|
||||||
|
m_config_folder = m_config_folder + "/" + m_port;
|
||||||
|
}
|
||||||
|
|
||||||
res = init_config();
|
res = init_config();
|
||||||
CHECK_AND_ASSERT_MES(res, false, "Failed to init config.");
|
CHECK_AND_ASSERT_MES(res, false, "Failed to init config.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user