diff --git a/nano/lib/stats_enums.hpp b/nano/lib/stats_enums.hpp index 4feccc2a30..8281754014 100644 --- a/nano/lib/stats_enums.hpp +++ b/nano/lib/stats_enums.hpp @@ -419,6 +419,7 @@ enum class detail activate_failed, activate_skip, activate_full, + scanned, // active insert, diff --git a/nano/node/backlog_scan.cpp b/nano/node/backlog_scan.cpp index dec7dcab6b..89893dda2c 100644 --- a/nano/node/backlog_scan.cpp +++ b/nano/node/backlog_scan.cpp @@ -128,12 +128,15 @@ void nano::backlog_scan::activate (secure::transaction const & transaction, nano auto const maybe_conf_info = ledger.store.confirmation_height.get (transaction, account); auto const conf_info = maybe_conf_info.value_or (nano::confirmation_height_info{}); + activated_info info{ account, account_info, conf_info }; + + stats.inc (nano::stat::type::backlog_scan, nano::stat::detail::scanned); + scanned.notify (transaction, info); + // If conf info is empty then it means then it means nothing is confirmed yet if (conf_info.height < account_info.block_count) { stats.inc (nano::stat::type::backlog_scan, nano::stat::detail::activated); - - activated_info info{ account, account_info, conf_info }; activated.notify (transaction, info); } } diff --git a/nano/node/backlog_scan.hpp b/nano/node/backlog_scan.hpp index 756c6deb27..2771ab7450 100644 --- a/nano/node/backlog_scan.hpp +++ b/nano/node/backlog_scan.hpp @@ -55,6 +55,7 @@ class backlog_scan final */ using callback_t = nano::observer_set; callback_t activated; + callback_t scanned; private: // Dependencies backlog_scan_config const & config;