aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwarptangent <warptangent@inbox.com>2015-02-18 20:52:44 -0800
committerwarptangent <warptangent@inbox.com>2015-02-23 00:33:38 -0800
commitb7a2d84919bc28b3747974509f932e64907e357a (patch)
tree48e2662576703cc8f4a57d05beed25672ed2e861 /src
parentBlockchainLMDB: Add support for batch transactions (diff)
downloadmonero-b7a2d84919bc28b3747974509f932e64907e357a.tar.xz
BlockchainLMDB: Add check for open database to two functions
Diffstat (limited to 'src')
-rw-r--r--src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
index c30a785ed..c3c0724ce 100644
--- a/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
+++ b/src/cryptonote_core/BlockchainDB_impl/db_lmdb.cpp
@@ -742,6 +742,7 @@ void BlockchainLMDB::close()
void BlockchainLMDB::sync()
{
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
+ check_open();
// Does nothing unless LMDB environment was opened with MDB_NOSYNC or in part
// MDB_NOMETASYNC. Force flush to be synchronous.
@@ -1757,6 +1758,8 @@ uint64_t BlockchainLMDB::add_block( const block& blk
void BlockchainLMDB::pop_block(block& blk, std::vector<transaction>& txs)
{
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
+ check_open();
+
txn_safe txn;
if (! m_batch_active)
{