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.
This commit is contained in:
Howard Chu 2016-12-31 19:38:55 -08:00 committed by Howard Chu
parent 0693cff925
commit eb1fb6011a
No known key found for this signature in database
GPG Key ID: FD2A70B44AB11BA7
1 changed files with 7 additions and 4 deletions

View File

@ -323,9 +323,9 @@ namespace cryptonote
LOG_PRINT_L0("Loading blockchain from folder " << folder.string() << " ..."); LOG_PRINT_L0("Loading blockchain from folder " << folder.string() << " ...");
const std::string filename = 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; blockchain_db_sync_mode sync_mode = db_async;
uint64_t blocks_per_sync = 1000; uint64_t blocks_per_sync = 1;
try try
{ {
@ -338,12 +338,12 @@ namespace cryptonote
for(const auto &option : options) for(const auto &option : options)
LOG_PRINT_L0("option: " << option); LOG_PRINT_L0("option: " << option);
// default to fast:async:1000 // default to fast:async:1
uint64_t DEFAULT_FLAGS = DBS_FAST_MODE; uint64_t DEFAULT_FLAGS = DBS_FAST_MODE;
if(options.size() == 0) if(options.size() == 0)
{ {
// temporarily default to fastest:async:1000 // default to fast:async:1
db_flags = DEFAULT_FLAGS; db_flags = DEFAULT_FLAGS;
} }
@ -359,7 +359,10 @@ namespace cryptonote
else if(options[0] == "fast") else if(options[0] == "fast")
db_flags = DBS_FAST_MODE; db_flags = DBS_FAST_MODE;
else if(options[0] == "fastest") else if(options[0] == "fastest")
{
db_flags = DBS_FASTEST_MODE; db_flags = DBS_FASTEST_MODE;
blocks_per_sync = 1000; // default to fastest:async:1000
}
else else
db_flags = DEFAULT_FLAGS; db_flags = DEFAULT_FLAGS;
} }