From f5581c35364ca71386d4ad4dc0c91cf0617339be Mon Sep 17 00:00:00 2001 From: warptangent Date: Sat, 13 Feb 2016 03:35:48 -0800 Subject: [PATCH] BlockchainLMDB: Replace remaining txn pointer NULLs with nullptr For consistency. --- src/blockchain_db/lmdb/db_lmdb.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 28e6f552..2d116c53 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -235,7 +235,7 @@ mdb_txn_safe::mdb_txn_safe() : m_txn(NULL) mdb_txn_safe::~mdb_txn_safe() { LOG_PRINT_L3("mdb_txn_safe: destructor"); - if (m_txn != NULL) + if (m_txn != nullptr) { if (m_batch_txn) // this is a batch txn and should have been handled before this point for safety { @@ -265,19 +265,19 @@ void mdb_txn_safe::commit(std::string message) if (auto result = mdb_txn_commit(m_txn)) { - m_txn = NULL; + m_txn = nullptr; throw0(DB_ERROR((message + ": ").append(mdb_strerror(result)).c_str())); } - m_txn = NULL; + m_txn = nullptr; } void mdb_txn_safe::abort() { LOG_PRINT_L3("mdb_txn_safe: abort()"); - if(m_txn != NULL) + if(m_txn != nullptr) { mdb_txn_abort(m_txn); - m_txn = NULL; + m_txn = nullptr; } else { @@ -2216,7 +2216,7 @@ void BlockchainLMDB::block_txn_stop() time_commit1 += time1; delete m_write_txn; - m_write_txn = NULL; + m_write_txn = nullptr; } } @@ -2226,7 +2226,7 @@ void BlockchainLMDB::block_txn_abort() if (! m_batch_active) { delete m_write_txn; - m_write_txn = NULL; + m_write_txn = nullptr; } } @@ -2280,7 +2280,7 @@ void BlockchainLMDB::pop_block(block& blk, std::vector& txs) BlockchainDB::pop_block(blk, txs); if (! m_batch_active) { - m_write_txn = NULL; + m_write_txn = nullptr; txn.commit(); } @@ -2288,7 +2288,7 @@ void BlockchainLMDB::pop_block(block& blk, std::vector& txs) catch (...) { m_num_outputs = num_outputs; - m_write_txn = NULL; + m_write_txn = nullptr; throw; }