From 0693cff9251f91a05dd96b2f8910faea29cb29ce Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 26 Dec 2016 14:29:46 -0800 Subject: Use batch transactions when syncing Faster throughput while avoiding corruption. I.e., makes running with --db-sync-mode safe more tolerable. --- src/blockchain_db/berkeleydb/db_bdb.cpp | 3 ++- src/blockchain_db/berkeleydb/db_bdb.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/blockchain_db/berkeleydb') diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp index 137ed9dc6..57d8371bd 100644 --- a/src/blockchain_db/berkeleydb/db_bdb.cpp +++ b/src/blockchain_db/berkeleydb/db_bdb.cpp @@ -1813,9 +1813,10 @@ bool BlockchainBDB::has_key_image(const crypto::key_image& img) const // Ostensibly BerkeleyDB has batch transaction support built-in, // so the following few functions will be NOP. -void BlockchainBDB::batch_start(uint64_t batch_num_blocks) +bool BlockchainBDB::batch_start(uint64_t batch_num_blocks) { LOG_PRINT_L3("BlockchainBDB::" << __func__); + return false; } void BlockchainBDB::batch_commit() diff --git a/src/blockchain_db/berkeleydb/db_bdb.h b/src/blockchain_db/berkeleydb/db_bdb.h index f320ab0e3..266e780c6 100644 --- a/src/blockchain_db/berkeleydb/db_bdb.h +++ b/src/blockchain_db/berkeleydb/db_bdb.h @@ -324,7 +324,7 @@ public: ); virtual void set_batch_transactions(bool batch_transactions); - virtual void batch_start(uint64_t batch_num_blocks=0); + virtual bool batch_start(uint64_t batch_num_blocks=0); virtual void batch_commit(); virtual void batch_stop(); virtual void batch_abort(); -- cgit v1.2.3