From 1aabd14c21221702b7efd84dfe43d17f6486db83 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 2 Feb 2018 15:08:22 +0000 Subject: db_lmdb: check hard fork info drop succeeded Coverity 136364 --- src/blockchain_db/lmdb/db_lmdb.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/blockchain_db/lmdb/db_lmdb.cpp') diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 6b81a4c90..604aae61e 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -3140,8 +3140,12 @@ void BlockchainLMDB::drop_hard_fork_info() TXN_PREFIX(0); - mdb_drop(*txn_ptr, m_hf_starting_heights, 1); - mdb_drop(*txn_ptr, m_hf_versions, 1); + auto result = mdb_drop(*txn_ptr, m_hf_starting_heights, 1); + if (result) + throw1(DB_ERROR(lmdb_error("Error dropping hard fork starting heights db: ", result).c_str())); + result = mdb_drop(*txn_ptr, m_hf_versions, 1); + if (result) + throw1(DB_ERROR(lmdb_error("Error dropping hard fork versions db: ", result).c_str())); TXN_POSTFIX_SUCCESS(); } -- cgit v1.2.3 From ad11db9144f766d86d4aa4904eecd446fb670597 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Fri, 2 Feb 2018 15:21:39 +0000 Subject: blockchain_db: initialize m_open in base class ctor It's cleaner this way, since it's a base class field Coverity 136568 --- src/blockchain_db/lmdb/db_lmdb.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/blockchain_db/lmdb/db_lmdb.cpp') diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 604aae61e..149da53b6 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1074,13 +1074,12 @@ BlockchainLMDB::~BlockchainLMDB() close(); } -BlockchainLMDB::BlockchainLMDB(bool batch_transactions) +BlockchainLMDB::BlockchainLMDB(bool batch_transactions): BlockchainDB() { LOG_PRINT_L3("BlockchainLMDB::" << __func__); // initialize folder to something "safe" just in case // someone accidentally misuses this class... m_folder = "thishsouldnotexistbecauseitisgibberish"; - m_open = false; m_batch_transactions = batch_transactions; m_write_txn = nullptr; -- cgit v1.2.3