aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/hardfork.cpp
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2016-02-18 12:09:57 +0000
committerHoward Chu <hyc@symas.com>2016-02-23 20:47:15 +0000
commit8cc7a36f0be2f90b62a6ffce840817e046e928a0 (patch)
tree70d2b704dc2a341ee573db9cbb0a7f12e45d5cf4 /src/cryptonote_core/hardfork.cpp
parentcore: check whether an update is needed straight away (diff)
downloadmonero-8cc7a36f0be2f90b62a6ffce840817e046e928a0.tar.xz
read txn/cursor stuff
Could wrap more later.
Diffstat (limited to 'src/cryptonote_core/hardfork.cpp')
-rw-r--r--src/cryptonote_core/hardfork.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cryptonote_core/hardfork.cpp b/src/cryptonote_core/hardfork.cpp
index e99736ff4..7e2e82c4a 100644
--- a/src/cryptonote_core/hardfork.cpp
+++ b/src/cryptonote_core/hardfork.cpp
@@ -254,8 +254,11 @@ bool HardFork::reorganize_from_chain_height(uint64_t height)
bool HardFork::rescan_from_block_height(uint64_t height)
{
CRITICAL_REGION_LOCAL(lock);
- if (height >= db.height())
+ db.block_txn_start(true);
+ if (height >= db.height()) {
+ db.block_txn_stop();
return false;
+ }
versions.clear();
@@ -273,6 +276,7 @@ bool HardFork::rescan_from_block_height(uint64_t height)
current_fork_index = 0;
while (current_fork_index + 1 < heights.size() && heights[current_fork_index].version != lastv)
++current_fork_index;
+ db.block_txn_stop();
return true;
}