diff options
author | Howard Chu <highlandsun@gmail.com> | 2016-12-26 14:29:46 -0800 |
---|---|---|
committer | Howard Chu <hyc@symas.com> | 2017-01-14 22:43:06 +0000 |
commit | 0693cff9251f91a05dd96b2f8910faea29cb29ce (patch) | |
tree | 51bc874f688229a4a1b582134521aaa674caf6a6 /src/blockchain_db/blockchain_db.h | |
parent | add tx hash to time stats (diff) | |
download | monero-0693cff9251f91a05dd96b2f8910faea29cb29ce.tar.xz |
Use batch transactions when syncing
Faster throughput while avoiding corruption. I.e., makes
running with --db-sync-mode safe more tolerable.
Diffstat (limited to 'src/blockchain_db/blockchain_db.h')
-rw-r--r-- | src/blockchain_db/blockchain_db.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h index 91c388de6..81380b56d 100644 --- a/src/blockchain_db/blockchain_db.h +++ b/src/blockchain_db/blockchain_db.h @@ -655,16 +655,17 @@ public: * been called. In either case, it should end the batch and write to its * backing store. * - * If a batch is already in-progress, this function should throw a DB_ERROR. - * This exception may change in the future if it is deemed necessary to - * have a more granular exception type for this scenario. + * If a batch is already in-progress, this function must return false. + * If a batch was started by this call, it must return true. * * If any of this cannot be done, the subclass should throw the corresponding * subclass of DB_EXCEPTION * * @param batch_num_blocks number of blocks to batch together + * + * @return true if we started the batch, false if already started */ - virtual void batch_start(uint64_t batch_num_blocks=0) = 0; + virtual bool batch_start(uint64_t batch_num_blocks=0) = 0; /** * @brief ends a batch transaction |