Merge pull request #5400

5e673c03 blockchain_db: fix db txn ending too early (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2019-04-16 22:30:40 +02:00
commit 46c477ab30
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD
9 changed files with 144 additions and 95 deletions

View file

@ -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;
}