diff options
author | Riccardo Spagni <ric@spagni.net> | 2015-12-09 10:30:17 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2015-12-09 10:30:20 +0200 |
commit | e175205e6e6314709aa1a8472f72be583771cd8a (patch) | |
tree | 8f659535b23d0ff35a0559fb274b39472513d25e /src/cryptonote_core | |
parent | Merge pull request #526 (diff) | |
parent | Register daemon command line arguments to core if they're used in core (diff) | |
download | monero-e175205e6e6314709aa1a8472f72be583771cd8a.tar.xz |
Merge pull request #527
336b375 Register daemon command line arguments to core if they're used in core (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 9881ae34f..2f21bd4f1 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -42,7 +42,6 @@ using namespace epee; #include "cryptonote_format_utils.h" #include "misc_language.h" #include <csignal> -#include "daemon/command_line_args.h" #include "cryptonote_core/checkpoints_create.h" #include "blockchain_db/blockchain_db.h" #include "blockchain_db/lmdb/db_lmdb.h" @@ -130,13 +129,27 @@ namespace cryptonote graceful_exit(); } //----------------------------------------------------------------------------------- - void core::init_options(boost::program_options::options_description& /*desc*/) + void core::init_options(boost::program_options::options_description& desc) { + command_line::add_arg(desc, command_line::arg_data_dir, tools::get_default_data_dir()); + command_line::add_arg(desc, command_line::arg_testnet_data_dir, (boost::filesystem::path(tools::get_default_data_dir()) / "testnet").string()); + + command_line::add_arg(desc, command_line::arg_test_drop_download); + command_line::add_arg(desc, command_line::arg_test_drop_download_height); + + command_line::add_arg(desc, command_line::arg_testnet_on); + command_line::add_arg(desc, command_line::arg_dns_checkpoints); + command_line::add_arg(desc, command_line::arg_db_type); + command_line::add_arg(desc, command_line::arg_prep_blocks_threads); + command_line::add_arg(desc, command_line::arg_fast_block_sync); + command_line::add_arg(desc, command_line::arg_db_sync_mode); + command_line::add_arg(desc, command_line::arg_show_time_stats); + command_line::add_arg(desc, command_line::arg_db_auto_remove_logs); } //----------------------------------------------------------------------------------------------- bool core::handle_command_line(const boost::program_options::variables_map& vm) { - m_testnet = command_line::get_arg(vm, daemon_args::arg_testnet_on); + m_testnet = command_line::get_arg(vm, command_line::arg_testnet_on); auto data_dir_arg = m_testnet ? command_line::arg_testnet_data_dir : command_line::arg_data_dir; m_config_folder = command_line::get_arg(vm, data_dir_arg); @@ -159,7 +172,7 @@ namespace cryptonote } - set_enforce_dns_checkpoints(command_line::get_arg(vm, daemon_args::arg_dns_checkpoints)); + set_enforce_dns_checkpoints(command_line::get_arg(vm, command_line::arg_dns_checkpoints)); test_drop_download_height(command_line::get_arg(vm, command_line::arg_test_drop_download_height)); if (command_line::get_arg(vm, command_line::arg_test_drop_download) == true) @@ -211,10 +224,10 @@ namespace cryptonote CHECK_AND_ASSERT_MES(r, false, "Failed to initialize memory pool"); #if BLOCKCHAIN_DB == DB_LMDB - std::string db_type = command_line::get_arg(vm, daemon_args::arg_db_type); - std::string db_sync_mode = command_line::get_arg(vm, daemon_args::arg_db_sync_mode); - bool fast_sync = command_line::get_arg(vm, daemon_args::arg_fast_block_sync) != 0; - uint64_t blocks_threads = command_line::get_arg(vm, daemon_args::arg_prep_blocks_threads); + std::string db_type = command_line::get_arg(vm, command_line::arg_db_type); + std::string db_sync_mode = command_line::get_arg(vm, command_line::arg_db_sync_mode); + bool fast_sync = command_line::get_arg(vm, command_line::arg_fast_block_sync) != 0; + uint64_t blocks_threads = command_line::get_arg(vm, command_line::arg_prep_blocks_threads); BlockchainDB* db = nullptr; uint64_t BDB_FAST_MODE = 0; @@ -309,7 +322,7 @@ namespace cryptonote blocks_per_sync = 1; } - bool auto_remove_logs = command_line::get_arg(vm, daemon_args::arg_db_auto_remove_logs) != 0; + bool auto_remove_logs = command_line::get_arg(vm, command_line::arg_db_auto_remove_logs) != 0; db->set_auto_remove_logs(auto_remove_logs); db->open(filename, db_flags); if(!db->m_open) @@ -326,7 +339,7 @@ namespace cryptonote r = m_blockchain_storage.init(db, m_testnet); - bool show_time_stats = command_line::get_arg(vm, daemon_args::arg_show_time_stats) != 0; + bool show_time_stats = command_line::get_arg(vm, command_line::arg_show_time_stats) != 0; m_blockchain_storage.set_show_time_stats(show_time_stats); #else r = m_blockchain_storage.init(m_config_folder, m_testnet); |