From 0674ea51feb44dff5f737c585d132cc00c57fca2 Mon Sep 17 00:00:00 2001 From: "crypro.zoidberg" Date: Thu, 9 May 2019 01:52:48 +0200 Subject: [PATCH] fixed alerts and fixed resync after daemon restart --- src/connectivity_tool/conn_tool.cpp | 1 + src/currency_core/blockchain_storage.cpp | 2 +- src/currency_core/currency_config.h | 2 +- src/p2p/net_node.inl | 12 ++++++------ utils/update_alert.json | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/connectivity_tool/conn_tool.cpp b/src/connectivity_tool/conn_tool.cpp index ac0586c6..98f2a53f 100644 --- a/src/connectivity_tool/conn_tool.cpp +++ b/src/connectivity_tool/conn_tool.cpp @@ -793,6 +793,7 @@ bool handle_increment_build_no(po::variables_map& vm) //--------------------------------------------------------------------------------------------------------------- bool handle_update_maintainers_info(po::variables_map& vm) { + log_space::log_singletone::add_logger(LOGGER_CONSOLE, NULL, NULL); if(!command_line::has_arg(vm, arg_rpc_port)) { std::cout << "ERROR: rpc port not set" << ENDL; diff --git a/src/currency_core/blockchain_storage.cpp b/src/currency_core/blockchain_storage.cpp index eee30813..7c99693a 100644 --- a/src/currency_core/blockchain_storage.cpp +++ b/src/currency_core/blockchain_storage.cpp @@ -58,7 +58,7 @@ using namespace currency; #define BLOCKCHAIN_STORAGE_OPTIONS_ID_CURRENT_BLOCK_CUMUL_SZ_LIMIT 0 #define BLOCKCHAIN_STORAGE_OPTIONS_ID_CURRENT_PRUNED_RS_HEIGHT 1 #define BLOCKCHAIN_STORAGE_OPTIONS_ID_LAST_WORKED_VERSION 2 -#define BLOCKCHAIN_STORAGE_OPTIONS_ID_STORAGE_MAJOR_COMPATIBILITY_VERSION 4 //mismatch here means full resync +#define BLOCKCHAIN_STORAGE_OPTIONS_ID_STORAGE_MAJOR_COMPATIBILITY_VERSION 3 //mismatch here means full resync #define BLOCKCHAIN_STORAGE_OPTIONS_ID_STORAGE_MINOR_COMPATIBILITY_VERSION 4 //mismatch here means some reinitializations #define TARGETDATA_CACHE_SIZE DIFFICULTY_WINDOW + 10 diff --git a/src/currency_core/currency_config.h b/src/currency_core/currency_config.h index a5488380..c406309c 100644 --- a/src/currency_core/currency_config.h +++ b/src/currency_core/currency_config.h @@ -205,7 +205,7 @@ #define CURRENT_TRANSACTION_CHAIN_ENTRY_ARCHIVE_VER 3 #define CURRENT_BLOCK_EXTENDED_INFO_ARCHIVE_VER 1 -#define BLOCKCHAIN_STORAGE_MAJOR_COMPATIBILITY_VERSION CURRENCY_FORMATION_VERSION + 4 +#define BLOCKCHAIN_STORAGE_MAJOR_COMPATIBILITY_VERSION CURRENCY_FORMATION_VERSION + 5 #define BLOCKCHAIN_STORAGE_MINOR_COMPATIBILITY_VERSION 1 diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index c7e18dac..2d3a9fc4 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -402,14 +402,14 @@ namespace nodetool template bool node_server::on_maintainers_entry_update() { - LOG_PRINT_MAGENTA("Fresh maintainers info recieved(timestamp: " << m_maintainers_info_local.timestamp << ")", LOG_LEVEL_0); + LOG_PRINT_CHANNEL_COLOR2(NULL, NULL, "Fresh maintainers info recieved(timestamp: " << m_maintainers_info_local.timestamp << ")", LOG_LEVEL_0, epee::log_space::console_color_magenta); if(PROJECT_VERSION_BUILD_NO < m_maintainers_info_local.build_no) { - LOG_PRINT_MAGENTA("Newer version avaliable: " << static_cast(m_maintainers_info_local.ver_major) << + LOG_PRINT_CHANNEL_COLOR2(NULL, NULL, "Newer version avaliable: " << static_cast(m_maintainers_info_local.ver_major) << "." << static_cast(m_maintainers_info_local.ver_minor) << "." << static_cast(m_maintainers_info_local.ver_revision) << "." << static_cast(m_maintainers_info_local.build_no) << - ", current version: " << PROJECT_VERSION_LONG, LOG_LEVEL_0); + ", current version: " << PROJECT_VERSION_LONG, LOG_LEVEL_0, epee::log_space::console_color_magenta); } handle_alert_conditions(); @@ -893,7 +893,7 @@ namespace nodetool if(m_alert_mode != ALERT_TYPE_CALM) return true; - LOG_PRINT_L0("This software is old, please update."); + LOG_PRINT_CHANNEL2(NULL, NULL, "This software is outdated, please update.", LOG_LEVEL_0); return true; } //----------------------------------------------------------------------------------- @@ -903,7 +903,7 @@ namespace nodetool if(m_alert_mode != ALERT_TYPE_URGENT) return true; - LOG_PRINT_CYAN("[URGENT]:This software is old, please update.", LOG_LEVEL_0); + LOG_PRINT_CHANNEL_COLOR2(NULL, NULL, "[URGENT]:This software is dramatically outdated, please update to latest version.", LOG_LEVEL_0, epee::log_space::console_color_cyan); return true; } //----------------------------------------------------------------------------------- @@ -913,7 +913,7 @@ namespace nodetool if(m_alert_mode != ALERT_TYPE_CRITICAL) return true; - LOG_PRINT_RED("[CRITICAL]:This software is old, please update.", LOG_LEVEL_0); + LOG_PRINT_CHANNEL_COLOR2(NULL, NULL, "[CRITICAL]:This software is critically outdated, please update to latest version.", LOG_LEVEL_0, epee::log_space::console_color_red); return true; } //----------------------------------------------------------------------------------- diff --git a/utils/update_alert.json b/utils/update_alert.json index 57641f30..da45cb11 100644 --- a/utils/update_alert.json +++ b/utils/update_alert.json @@ -2,10 +2,10 @@ "maj":1, "min":0, "rev":0, - "build":8, + "build":26, "cs":[ { - "build":7, + "build":26, "mode":3 } ]