aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_basic
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-04-16 22:30:40 +0200
committerRiccardo Spagni <ric@spagni.net>2019-04-16 22:30:40 +0200
commit46c477ab308f0c051b13e3356c24ebc2257bf0a6 (patch)
treef805eef0733c7d2da03535fb9bb1bcf799d276af /src/cryptonote_basic
parentMerge pull request #5440 (diff)
parentblockchain_db: fix db txn ending too early (diff)
downloadmonero-46c477ab308f0c051b13e3356c24ebc2257bf0a6.tar.xz
Merge pull request #5400
5e673c03 blockchain_db: fix db txn ending too early (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_basic')
-rw-r--r--src/cryptonote_basic/hardfork.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/cryptonote_basic/hardfork.cpp b/src/cryptonote_basic/hardfork.cpp
index 89bca2f09..61240ea37 100644
--- a/src/cryptonote_basic/hardfork.cpp
+++ b/src/cryptonote_basic/hardfork.cpp
@@ -266,11 +266,9 @@ bool HardFork::reorganize_from_chain_height(uint64_t height)
bool HardFork::rescan_from_block_height(uint64_t height)
{
CRITICAL_REGION_LOCAL(lock);
- db.block_txn_start(true);
- if (height >= db.height()) {
- db.block_txn_stop();
+ db_rtxn_guard rtxn_guard(&db);
+ if (height >= db.height())
return false;
- }
versions.clear();
@@ -293,8 +291,6 @@ bool HardFork::rescan_from_block_height(uint64_t height)
current_fork_index = voted;
}
- db.block_txn_stop();
-
return true;
}