aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Chu <highlandsun@gmail.com>2016-12-31 19:38:55 -0800
committerHoward Chu <hyc@symas.com>2017-01-14 22:43:06 +0000
commiteb1fb6011a233d515a2ad97c6983d960f0a72caf (patch)
treefd361bfed6ab991d9827055dcaea68243152b587
parentUse batch transactions when syncing (diff)
downloadmonero-eb1fb6011a233d515a2ad97c6983d960f0a72caf.tar.xz
Tweak default db-sync-mode to fast:async:1
fsync the DB asynchronously, to allow block download/verification to proceed while syncing. Sync after every batch. Note that "fastest" still defaults to fastest:async:1000.
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 4010d3d44..cd3ed9ab0 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -323,9 +323,9 @@ namespace cryptonote
LOG_PRINT_L0("Loading blockchain from folder " << folder.string() << " ...");
const std::string filename = folder.string();
- // temporarily default to fastest:async:1000
+ // default to fast:async:1
blockchain_db_sync_mode sync_mode = db_async;
- uint64_t blocks_per_sync = 1000;
+ uint64_t blocks_per_sync = 1;
try
{
@@ -338,12 +338,12 @@ namespace cryptonote
for(const auto &option : options)
LOG_PRINT_L0("option: " << option);
- // default to fast:async:1000
+ // default to fast:async:1
uint64_t DEFAULT_FLAGS = DBS_FAST_MODE;
if(options.size() == 0)
{
- // temporarily default to fastest:async:1000
+ // default to fast:async:1
db_flags = DEFAULT_FLAGS;
}
@@ -359,7 +359,10 @@ namespace cryptonote
else if(options[0] == "fast")
db_flags = DBS_FAST_MODE;
else if(options[0] == "fastest")
+ {
db_flags = DBS_FASTEST_MODE;
+ blocks_per_sync = 1000; // default to fastest:async:1000
+ }
else
db_flags = DEFAULT_FLAGS;
}