diff options
Diffstat (limited to 'src/blockchain_db')
-rw-r--r-- | src/blockchain_db/berkeleydb/db_bdb.cpp | 4 | ||||
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp index 1ccb6be12..02fdaba2f 100644 --- a/src/blockchain_db/berkeleydb/db_bdb.cpp +++ b/src/blockchain_db/berkeleydb/db_bdb.cpp @@ -783,9 +783,11 @@ void BlockchainBDB::open(const std::string& filename, const int db_flags) m_env->set_lk_max_locks(DB_MAX_LOCKS); m_env->set_lk_max_lockers(DB_MAX_LOCKS); m_env->set_lk_max_objects(DB_MAX_LOCKS); - + + #ifndef __OpenBSD__ //OpenBSD's DB package is too old to support this feature if(m_auto_remove_logs) m_env->log_set_config(DB_LOG_AUTO_REMOVE, 1); + #endif // last parameter left 0, files will be created with default rw access m_env->open(filename.c_str(), db_env_open_flags, 0); diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index 17a0f9ec2..c18db7724 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -654,9 +654,11 @@ void BlockchainLMDB::remove_transaction_data(const crypto::hash& tx_hash, const remove_tx_outputs(tx_hash, tx); - if (mdb_del(*m_write_txn, m_tx_outputs, &val_h, NULL)) - throw1(DB_ERROR("Failed to add removal of tx outputs to db transaction")); - + auto result = mdb_del(*m_write_txn, m_tx_outputs, &val_h, NULL); + if (result == MDB_NOTFOUND) + LOG_PRINT_L1("tx has no outputs to remove: " << tx_hash); + else if (result) + throw1(DB_ERROR(std::string("Failed to add removal of tx outputs to db transaction: ").append(mdb_strerror(result)).c_str())); } void BlockchainLMDB::add_output(const crypto::hash& tx_hash, const tx_out& tx_output, const uint64_t& local_index, const uint64_t unlock_time) @@ -718,7 +720,7 @@ void BlockchainLMDB::remove_tx_outputs(const crypto::hash& tx_hash, const transa auto result = mdb_cursor_get(cur, &k, &v, MDB_SET); if (result == MDB_NOTFOUND) { - LOG_ERROR("Attempting to remove a tx's outputs, but none found. Continuing, but...be wary, because that's weird."); + LOG_PRINT_L2("tx has no outputs, so no global output indices"); } else if (result) { |