Skip to content

Commit

Permalink
unify bootstrap unblock
Browse files Browse the repository at this point in the history
  • Loading branch information
gr0vity committed Nov 12, 2024
1 parent eec24a3 commit a770221
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions nano/node/bootstrap/account_sets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,14 @@ void nano::bootstrap::account_sets::unblock (nano::account const & account, std:

// Unblock only if the dependency is fulfilled
auto existing = blocking.get<tag_account> ().find (account);

if (existing != blocking.get<tag_account> ().end () && (!hash || existing->dependency == *hash))
{
stats.inc (nano::stat::type::bootstrap_account_sets, nano::stat::detail::unblock);

debug_assert (priorities.get<tag_account> ().count (account) == 0);
if (!existing->original_entry.account.is_zero ())
{
debug_assert (existing->original_entry.account == account);
priorities.get<tag_account> ().insert (existing->original_entry);
}
else
{
priorities.get<tag_account> ().insert ({ account, account_sets::priority_initial });
}
blocking.get<tag_account> ().erase (account);

priorities.get<tag_account> ().insert ({ account, account_sets::priority_initial });
blocking.get<tag_account> ().erase (account);
trim_overflow ();
}
else
Expand Down

0 comments on commit a770221

Please sign in to comment.