diff --git a/nano/lib/stats_enums.hpp b/nano/lib/stats_enums.hpp index 9b27ee8ad8..f91318e17a 100644 --- a/nano/lib/stats_enums.hpp +++ b/nano/lib/stats_enums.hpp @@ -365,6 +365,7 @@ enum class detail failed_send_telemetry_req, empty_payload, cleanup_outdated, + erase_stale, // vote generator generator_broadcasts, diff --git a/nano/node/telemetry.cpp b/nano/node/telemetry.cpp index dc3077e508..c197ee86bf 100644 --- a/nano/node/telemetry.cpp +++ b/nano/node/telemetry.cpp @@ -244,10 +244,14 @@ void nano::telemetry::cleanup () // Remove if telemetry data is stale if (!check_timeout (entry)) { - stats.inc (nano::stat::type::telemetry, nano::stat::detail::cleanup_outdated); + stats.inc (nano::stat::type::telemetry, nano::stat::detail::erase_stale); + return true; // Erase + } + if (!entry.channel->alive ()) + { + stats.inc (nano::stat::type::telemetry, nano::stat::detail::erase_dead); return true; // Erase } - return false; // Do not erase }); }