diff --git a/src/currency_core/tx_pool.cpp b/src/currency_core/tx_pool.cpp index 830e49db..66922931 100644 --- a/src/currency_core/tx_pool.cpp +++ b/src/currency_core/tx_pool.cpp @@ -24,8 +24,6 @@ DISABLE_VS_WARNINGS(4244 4345 4503) //'boost::foreach_detail_::or_' : decorated name length exceeded, name was truncated -//#define TRANSACTION_POOL_MAJOR_COMPATIBILITY_VERSION BLOCKCHAIN_STORAGE_MAJOR_COMPATIBILITY_VERSION + 1 - #undef LOG_DEFAULT_CHANNEL #define LOG_DEFAULT_CHANNEL "tx_pool" ENABLE_CHANNEL_BY_DEFAULT("tx_pool"); @@ -472,7 +470,6 @@ namespace currency { auto& tx_entry = td.second; const crypto::hash& h = td.first; - //m_db_transactions.enumerate_items([&](uint64_t i, const crypto::hash& h, const tx_details &tx_entry) //never remove transactions which related to alt blocks, //or we can get network split as a worst case (impossible to switch to @@ -1179,13 +1176,6 @@ namespace currency return true; } //--------------------------------------------------------------------------------- - void tx_memory_pool::initialize_db_solo_options_values() - { - //m_db.begin_transaction(); - //m_db_storage_major_compatibility_version = TRANSACTION_POOL_MAJOR_COMPATIBILITY_VERSION; - //m_db.commit_transaction(); - } - //--------------------------------------------------------------------------------- bool tx_memory_pool::init(const std::string& config_folder) { m_config_folder = config_folder; @@ -1198,23 +1188,10 @@ namespace currency bool res = tools::unserialize_obj_from_file(*this, filename); if(!res) { - LOG_PRINT_L0("Failed to load tx pool from " << filename); + LOG_ERROR("Failed to load tx pool from " << filename); + return false; } - - // TODO - - bool need_reinit = false; - //if (m_db_storage_major_compatibility_version != TRANSACTION_POOL_MAJOR_COMPATIBILITY_VERSION) - // need_reinit = true; - - if (need_reinit) - { - clear(); - LOG_PRINT_MAGENTA("Tx Pool reinitialized.", LOG_LEVEL_0); - } - initialize_db_solo_options_values(); - LOG_PRINT_GREEN("TX_POOL Initialized ok. (" << m_transactions.size() << " transactions)", LOG_LEVEL_0); return true; } diff --git a/src/currency_core/tx_pool.h b/src/currency_core/tx_pool.h index fb0962e5..1119c1df 100644 --- a/src/currency_core/tx_pool.h +++ b/src/currency_core/tx_pool.h @@ -159,7 +159,6 @@ namespace currency bool remove_alias_info(const transaction& tx); bool is_valid_contract_finalization_tx(const transaction &tx)const; - void initialize_db_solo_options_values(); bool remove_stuck_transactions(); bool is_transaction_ready_to_go(tx_details& txd, const crypto::hash& id)const; bool validate_alias_info(const transaction& tx, bool is_in_block)const; @@ -170,22 +169,12 @@ namespace currency void set_taken(const crypto::hash& id); void reset_all_taken(); - - //typedef tools::db::cached_key_value_accessor transactions_container; - //typedef tools::db::cached_key_value_accessor hash_container; - //typedef tools::db::cached_key_value_accessor key_images_container; - //typedef tools::db::cached_key_value_accessor solo_options_container; - //typedef tools::db::cached_key_value_accessor aliases_container; - //typedef tools::db::cached_key_value_accessor address_to_aliases_container; - typedef std::unordered_map transactions_container; typedef std::unordered_map key_images_container; typedef std::unordered_set hash_container; typedef std::unordered_set aliases_container; typedef std::unordered_set aliases_addresses_container; - - //main accessor epee::shared_recursive_mutex m_dummy_rw_lock; mutable epee::critical_section m_transactions_lock; @@ -198,9 +187,6 @@ namespace currency aliases_container m_alias_names_set; aliases_addresses_container m_alias_addresses_set; - //tools::db::solo_db_value m_db_storage_major_compatibility_version; -- TODO - - epee::math_helper::once_a_time_seconds<30> m_remove_stuck_tx_interval; performnce_data m_performance_data;