aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/hardfork.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cryptonote_core/hardfork.cpp')
-rw-r--r--src/cryptonote_core/hardfork.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cryptonote_core/hardfork.cpp b/src/cryptonote_core/hardfork.cpp
index 50da70050..546af2076 100644
--- a/src/cryptonote_core/hardfork.cpp
+++ b/src/cryptonote_core/hardfork.cpp
@@ -222,7 +222,7 @@ bool HardFork::reorganize_from_block_height(uint64_t height)
return false;
db.set_batch_transactions(true);
- db.batch_start();
+ bool stop_batch = db.batch_start();
versions.clear();
@@ -250,7 +250,8 @@ bool HardFork::reorganize_from_block_height(uint64_t height)
add(db.get_block_from_height(h), h);
}
- db.batch_stop();
+ if (stop_batch)
+ db.batch_stop();
return true;
}