aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-03-03 18:56:46 +0200
committerRiccardo Spagni <ric@spagni.net>2017-03-03 18:56:46 +0200
commit3e761c137da73b9f82c8c26f8896e8781dbf062e (patch)
tree7df46c322b5f5f0de30df1086890014638d7fa02 /src/cryptonote_core
parentMerge pull request #1831 (diff)
parentRemove redundant num_txs() method (diff)
downloadmonero-3e761c137da73b9f82c8c26f8896e8781dbf062e.tar.xz
Merge pull request #1832
eb62dcc8 Remove redundant num_txs() method (Howard Chu) 296641e0 Fix #1824 don't end batch that we didn't start (Howard Chu)
Diffstat (limited to 'src/cryptonote_core')
-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;
}