Optimize backlog_population::activate

This commit is contained in:
Piotr Wójcik 2024-05-22 14:59:16 +02:00
commit a29b618296
2 changed files with 5 additions and 10 deletions

View file

@ -105,7 +105,9 @@ void nano::backlog_population::populate_backlog (nano::unique_lock<nano::mutex>
stats.inc (nano::stat::type::backlog, nano::stat::detail::total);
auto const & account = i->first;
activate (transaction, account);
auto const & account_info = i->second;
activate (transaction, account, account_info);
next = account.number () + 1;
}
done = ledger.store.account.begin (transaction, next) == end;
@ -118,15 +120,8 @@ void nano::backlog_population::populate_backlog (nano::unique_lock<nano::mutex>
}
}
void nano::backlog_population::activate (secure::transaction const & transaction, nano::account const & account)
void nano::backlog_population::activate (secure::transaction const & transaction, nano::account const & account, nano::account_info const & account_info)
{
auto const maybe_account_info = ledger.store.account.get (transaction, account);
if (!maybe_account_info)
{
return;
}
auto const account_info = *maybe_account_info;
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{});

View file

@ -66,7 +66,7 @@ private:
bool predicate () const;
void populate_backlog (nano::unique_lock<nano::mutex> & lock);
void activate (secure::transaction const &, nano::account const &);
void activate (secure::transaction const &, nano::account const &, nano::account_info const &);
/** This is a manual trigger, the ongoing backlog population does not use this.
* It can be triggered even when backlog population (frontiers confirmation) is disabled. */