diff options
| author | Howard Chu <hyc@symas.com> | 2017-03-03 16:50:53 +0000 |
|---|---|---|
| committer | Howard Chu <hyc@symas.com> | 2017-03-03 16:50:53 +0000 |
| commit | 296641e047fa79d2651045f12f79738fd8668c46 (patch) | |
| tree | 8f817a752bee76aa9c2d40268835e940f008f14a | |
| parent | 4e92ef4aa4f2272cf4187420e6d5e4aa331ff6e3 (diff) | |
| download | monzero-core-296641e047fa79d2651045f12f79738fd8668c46.tar.gz monzero-core-296641e047fa79d2651045f12f79738fd8668c46.tar.xz monzero-core-296641e047fa79d2651045f12f79738fd8668c46.zip | |
Fix #1824 don't end batch that we didn't start
| -rw-r--r-- | src/cryptonote_core/hardfork.cpp | 5 |
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; } |
