aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.h
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2017-08-19 19:36:51 +0100
committerHoward Chu <hyc@symas.com>2017-08-20 16:30:28 +0100
commit9a859844f496158b8237bbd08ff0f608dc5a6385 (patch)
tree01b471ca8a5f334112bd777a10962853aedbffe3 /src/cryptonote_core/blockchain.h
parentDB cleanup (diff)
downloadmonero-9a859844f496158b8237bbd08ff0f608dc5a6385.tar.xz
Toggle SAFE syncmode on and off automatically
If monerod is started with default sync mode, set it to SAFE after synchronization completes. Set it back to FAST if synchronization restarts (e.g. because another peer has a longer blockchain). If monerod is started with an explicit sync mode, none of this automation takes effect.
Diffstat (limited to 'src/cryptonote_core/blockchain.h')
-rw-r--r--src/cryptonote_core/blockchain.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.h b/src/cryptonote_core/blockchain.h
index 7fa78584b..b8ea657b4 100644
--- a/src/cryptonote_core/blockchain.h
+++ b/src/cryptonote_core/blockchain.h
@@ -65,6 +65,7 @@ namespace cryptonote
*/
enum blockchain_db_sync_mode
{
+ db_defaultsync, //!< user didn't specify, use db_async
db_sync, //!< handle syncing calls instead of the backing db, synchronously
db_async, //!< handle syncing calls instead of the backing db, asynchronously
db_nosync //!< Leave syncing up to the backing db (safest, but slowest because of disk I/O)
@@ -701,6 +702,11 @@ namespace cryptonote
blockchain_db_sync_mode sync_mode, bool fast_sync);
/**
+ * @brief Put DB in safe sync mode
+ */
+ void safesyncmode(const bool onoff);
+
+ /**
* @brief set whether or not to show/print time statistics
*
* @param stats the new time stats setting
@@ -932,6 +938,7 @@ namespace cryptonote
blockchain_db_sync_mode m_db_sync_mode;
bool m_fast_sync;
bool m_show_time_stats;
+ bool m_db_default_sync;
uint64_t m_db_blocks_per_sync;
uint64_t m_max_prepare_blocks_threads;
uint64_t m_fake_pow_calc_time;