aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJamesWrigley <james@puiterwijk.org>2019-11-01 16:16:37 +0100
committerJamesWrigley <james@puiterwijk.org>2019-11-01 23:56:08 +0100
commitb9fc206660089fd73eb30acfecfccadd6717dd06 (patch)
tree327106991d6ca228ff12afa4b71d7d9502d4f1b1 /src
parentMerge pull request #6059 (diff)
downloadmonero-b9fc206660089fd73eb30acfecfccadd6717dd06.tar.xz
Add a --keep-fakechain option to keep fakechain databases
This is handy when doing tests that generate a lot of transactions, since that takes time it's preferable to re-use the database for future runs.
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index acb494a49..cfb3e36f7 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -83,6 +83,11 @@ namespace cryptonote
, "Run in a regression testing mode."
, false
};
+ const command_line::arg_descriptor<bool> arg_keep_fakechain = {
+ "keep-fakechain"
+ , "Don't delete any existing database when in fakechain mode."
+ , false
+ };
const command_line::arg_descriptor<difficulty_type> arg_fixed_difficulty = {
"fixed-difficulty"
, "Fixed difficulty used for testing."
@@ -315,6 +320,7 @@ namespace cryptonote
command_line::add_arg(desc, arg_testnet_on);
command_line::add_arg(desc, arg_stagenet_on);
command_line::add_arg(desc, arg_regtest_on);
+ command_line::add_arg(desc, arg_keep_fakechain);
command_line::add_arg(desc, arg_fixed_difficulty);
command_line::add_arg(desc, arg_dns_checkpoints);
command_line::add_arg(desc, arg_prep_blocks_threads);
@@ -468,6 +474,7 @@ namespace cryptonote
size_t max_txpool_weight = command_line::get_arg(vm, arg_max_txpool_weight);
bool prune_blockchain = command_line::get_arg(vm, arg_prune_blockchain);
bool keep_alt_blocks = command_line::get_arg(vm, arg_keep_alt_blocks);
+ bool keep_fakechain = command_line::get_arg(vm, arg_keep_fakechain);
boost::filesystem::path folder(m_config_folder);
if (m_nettype == FAKECHAIN)
@@ -509,7 +516,7 @@ namespace cryptonote
bool sync_on_blocks = true;
uint64_t sync_threshold = 1;
- if (m_nettype == FAKECHAIN)
+ if (m_nettype == FAKECHAIN && !keep_fakechain)
{
// reset the db by removing the database file before opening it
if (!db->remove_data_file(filename))