diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-10-04 11:41:13 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-10-04 11:41:13 +0200 |
commit | fa1d5efb5a7038bc7c54687db3da3b0c8fb54157 (patch) | |
tree | 5a23088414f6401011128879dce17dfcbf3b976b /src/cryptonote_core/tx_pool.cpp | |
parent | Merge pull request #1167 (diff) | |
parent | Brackets to prevent premature return (diff) | |
download | monero-fa1d5efb5a7038bc7c54687db3da3b0c8fb54157.tar.xz |
Merge pull request #1168
10be903 Brackets to prevent premature return (NanoAkron)
fb1785a Brackets to ensure doesn't function prematurely return (NanoAkron)
8ed0d72 Moved logging to target functions rather than caller (NanoAkron)
442bfd1 Added messages at log level 2 to reflect deactivation procedure (NanoAkron)
Diffstat (limited to 'src/cryptonote_core/tx_pool.cpp')
-rw-r--r-- | src/cryptonote_core/tx_pool.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index 46fab4dcf..5bfa7eca6 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -689,7 +689,7 @@ namespace cryptonote bool res = tools::unserialize_obj_from_file(*this, state_file_path); if(!res) { - LOG_PRINT_L1("Failed to load memory pool from file " << state_file_path); + LOG_ERROR("Failed to load memory pool from file " << state_file_path); m_transactions.clear(); m_txs_by_fee.clear(); @@ -710,12 +710,17 @@ namespace cryptonote //TODO: investigate whether only ever returning true is correct bool tx_memory_pool::deinit() { + LOG_PRINT_L1("Received signal to deactivate memory pool store"); + if (m_config_folder.empty()) + { + LOG_PRINT_L1("Memory pool store already empty"); return true; + } if (!tools::create_directories_if_necessary(m_config_folder)) { - LOG_PRINT_L1("Failed to create data directory: " << m_config_folder); + LOG_ERROR("Failed to create memory pool data directory: " << m_config_folder); return false; } @@ -723,8 +728,14 @@ namespace cryptonote bool res = tools::serialize_obj_to_file(*this, state_file_path); if(!res) { - LOG_PRINT_L1("Failed to serialize memory pool to file " << state_file_path); + LOG_ERROR("Failed to serialize memory pool to file " << state_file_path); + return false; } - return true; + else + { + LOG_PRINT_L1("Memory pool store deactivated successfully"); + return true; + } + } } |