BlockchainLMDB: Add check for open database to two functions
This commit is contained in:
parent
58ecc58be1
commit
b7a2d84919
1 changed files with 3 additions and 0 deletions
|
@ -742,6 +742,7 @@ void BlockchainLMDB::close()
|
||||||
void BlockchainLMDB::sync()
|
void BlockchainLMDB::sync()
|
||||||
{
|
{
|
||||||
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
||||||
|
check_open();
|
||||||
|
|
||||||
// Does nothing unless LMDB environment was opened with MDB_NOSYNC or in part
|
// Does nothing unless LMDB environment was opened with MDB_NOSYNC or in part
|
||||||
// MDB_NOMETASYNC. Force flush to be synchronous.
|
// 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)
|
void BlockchainLMDB::pop_block(block& blk, std::vector<transaction>& txs)
|
||||||
{
|
{
|
||||||
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
LOG_PRINT_L3("BlockchainLMDB::" << __func__);
|
||||||
|
check_open();
|
||||||
|
|
||||||
txn_safe txn;
|
txn_safe txn;
|
||||||
if (! m_batch_active)
|
if (! m_batch_active)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue