aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/cryptonote_core.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-12-13 22:14:50 +0200
committerRiccardo Spagni <ric@spagni.net>2015-12-13 22:14:56 +0200
commitbdf738bc7ff996f95276fceb78c66c1aee19de08 (patch)
tree63f63c88aa91688ad9f9d394154471c038174d3a /src/cryptonote_core/cryptonote_core.cpp
parent281c1c16397290616a323950fc18fcea883734de (diff)
parentcbded439f45c5867e76758825f70284daca2eb47 (diff)
downloadmonzero-core-bdf738bc7ff996f95276fceb78c66c1aee19de08.tar.gz
monzero-core-bdf738bc7ff996f95276fceb78c66c1aee19de08.tar.xz
monzero-core-bdf738bc7ff996f95276fceb78c66c1aee19de08.zip
Merge pull request #531
cbded43 core_tests: fix ring_signature_1 tests (moneromooo-monero) c3d208f core_tests: bump default test fee to 0.02 monero (moneromooo-monero) 10da0a0 add a --fakechain argument for tests (moneromooo-monero) eee44e6 unit_tests: fix block reward test using post hard fork settings (moneromooo-monero) 595893f blockchain: log block (not chain) height in "BLOCK SUCCESFULLY ADDED" (moneromooo-monero) 2369968 blockchain: fix off by one in get_blocks (moneromooo-monero) 8af913a db_lmdb: implement BlockchainLMDB::reset (moneromooo-monero) 4833f4f db_bdb: implement BlockchainBDB::reset (moneromooo-monero) 18bf06e tx_pool: fix "minumim" typo in message (moneromooo-monero) 44f1267 tests: fix a typo in test name (moneromooo-monero) 1494557 db_lmdb: create all needed directories, not just the leaf one (moneromooo-monero) 015b68a db_bdb: create all needed directories, not just the leaf one (moneromooo-monero) f141869 tests: remove data-dir argument registration (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 2f21bd4f1..960c8eff8 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -97,7 +97,7 @@ namespace cryptonote
//-----------------------------------------------------------------------------------------------
bool core::update_checkpoints()
{
- if (m_testnet) return true;
+ if (m_testnet || m_fakechain) return true;
if (m_checkpoints_updating.test_and_set()) return true;
@@ -145,18 +145,20 @@ namespace cryptonote
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);
+ command_line::add_arg(desc, command_line::arg_fakechain);
}
//-----------------------------------------------------------------------------------------------
bool core::handle_command_line(const boost::program_options::variables_map& vm)
{
m_testnet = command_line::get_arg(vm, command_line::arg_testnet_on);
+ m_fakechain = command_line::get_arg(vm, command_line::arg_fakechain);
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);
auto data_dir = boost::filesystem::path(m_config_folder);
- if (!m_testnet)
+ if (!m_testnet && !m_fakechain)
{
cryptonote::checkpoints checkpoints;
if (!cryptonote::create_checkpoints(checkpoints))
@@ -257,6 +259,9 @@ namespace cryptonote
boost::filesystem::path folder(m_config_folder);
+ if (m_fakechain)
+ folder /= "fake";
+
folder /= db->get_db_name();
LOG_PRINT_L0("Loading blockchain from folder " << folder.string() << " ...");
@@ -337,7 +342,7 @@ namespace cryptonote
m_blockchain_storage.set_user_options(blocks_threads,
blocks_per_sync, sync_mode, fast_sync);
- r = m_blockchain_storage.init(db, m_testnet);
+ r = m_blockchain_storage.init(db, m_testnet, m_fakechain);
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);