Backlog scan scanned event
This commit is contained in:
parent
8f6860b6dc
commit
7ae7c8a420
3 changed files with 7 additions and 2 deletions
|
|
@ -419,6 +419,7 @@ enum class detail
|
|||
activate_failed,
|
||||
activate_skip,
|
||||
activate_full,
|
||||
scanned,
|
||||
|
||||
// active
|
||||
insert,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ public:
|
|||
*/
|
||||
using callback_t = nano::observer_set<nano::secure::transaction const &, activated_info const &>;
|
||||
callback_t activated;
|
||||
callback_t scanned;
|
||||
|
||||
private: // Dependencies
|
||||
backlog_scan_config const & config;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue