aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-02-21 00:51:13 +0200
committerRiccardo Spagni <ric@spagni.net>2017-02-21 00:51:13 +0200
commit675434ffab89fd22b03398ae2075fee42ed643e0 (patch)
tree3d3b3f12ded75b623db2c96e3d5bcc6ab38e3c56 /src/cryptonote_core/blockchain.cpp
parentfb9e4e15edac48ce80da2e4c9aba1cb57a46c787 (diff)
parentbed2d9f231cbe30c6935e267eee9f272c852809f (diff)
downloadmonzero-core-675434ffab89fd22b03398ae2075fee42ed643e0.tar.gz
monzero-core-675434ffab89fd22b03398ae2075fee42ed643e0.tar.xz
monzero-core-675434ffab89fd22b03398ae2075fee42ed643e0.zip
Merge pull request #1748
bed2d9f2 Get rid of directory lock (Howard Chu) 2e913676 Handle map resizes from other processes (Howard Chu) bf1348b7 Can't cache num_txs or num_outputs either (Howard Chu) dc53e9ee Add a few read txns to streamline (Howard Chu)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index a81286632..d5fefffcd 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -1986,12 +1986,14 @@ bool Blockchain::find_blockchain_supplement(const std::list<crypto::hash>& qbloc
return false;
}
+ m_db->block_txn_start(true);
resp.total_height = get_current_blockchain_height();
size_t count = 0;
for(size_t i = resp.start_height; i < resp.total_height && count < BLOCKS_IDS_SYNCHRONIZING_DEFAULT_COUNT; i++, count++)
{
resp.m_block_ids.push_back(m_db->get_block_hash_from_height(i));
}
+ m_db->block_txn_stop();
return true;
}
//------------------------------------------------------------------
@@ -2022,6 +2024,7 @@ bool Blockchain::find_blockchain_supplement(const uint64_t req_start_block, cons
}
}
+ m_db->block_txn_start(true);
total_height = get_current_blockchain_height();
size_t count = 0;
for(size_t i = start_height; i < total_height && count < max_count; i++, count++)
@@ -2032,6 +2035,7 @@ bool Blockchain::find_blockchain_supplement(const uint64_t req_start_block, cons
get_transactions(blocks.back().first.tx_hashes, blocks.back().second, mis);
CHECK_AND_ASSERT_MES(!mis.size(), false, "internal error, transaction from block not found");
}
+ m_db->block_txn_stop();
return true;
}
//------------------------------------------------------------------