From 8f2a99d8ab1d3ea23c1968d6b3f1b43fd7faff89 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 24 May 2019 08:33:19 +0000 Subject: core: do not commit half constructed batch db txn --- src/blockchain_db/blockchain_db.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/blockchain_db/blockchain_db.h') diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h index 567be6a65..b6b8c6c3e 100644 --- a/src/blockchain_db/blockchain_db.h +++ b/src/blockchain_db/blockchain_db.h @@ -753,6 +753,21 @@ public: */ virtual void batch_stop() = 0; + /** + * @brief aborts a batch transaction + * + * If the subclass implements batching, this function should abort the + * batch it is currently on. + * + * If no batch is 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 any of this cannot be done, the subclass should throw the corresponding + * subclass of DB_EXCEPTION + */ + virtual void batch_abort() = 0; + /** * @brief sets whether or not to batch transactions * -- cgit v1.2.3