aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2017-03-03 16:50:53 +0000
committerHoward Chu <hyc@symas.com>2017-03-03 16:50:53 +0000
commit296641e047fa79d2651045f12f79738fd8668c46 (patch)
tree8f817a752bee76aa9c2d40268835e940f008f14a /src
parentMerge pull request #1831 (diff)
downloadmonero-296641e047fa79d2651045f12f79738fd8668c46.tar.xz
Fix #1824 don't end batch that we didn't start
Diffstat (limited to 'src')
-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;
}