Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Nov 28, 2024
1 parent 94ef461 commit 88465ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions nano/node/bounded_backlog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,10 @@ size_t nano::bounded_backlog::index_size () const
return index.size ();
}

bool nano::bounded_backlog::erase (nano::secure::transaction const & transaction, nano::account const & account)
{
nano::lock_guard<nano::mutex> guard{ mutex };
return index.erase (account);
}

void nano::bounded_backlog::activate (nano::secure::transaction & transaction, nano::account const & account, nano::account_info const & account_info, nano::confirmation_height_info const & conf_info)
{
debug_assert (conf_info.frontier != account_info.head);

auto contains = [this] (nano::block_hash const & hash) {
nano::lock_guard<nano::mutex> guard{ mutex };
return index.contains (hash);
};

// Insert blocks into the index starting from the account head block
auto block = ledger.any.block_get (transaction, account_info.head);
while (block)
Expand Down Expand Up @@ -420,6 +409,12 @@ void nano::bounded_backlog::run_scan ()
}
}

bool nano::bounded_backlog::contains (nano::block_hash const & hash) const
{
nano::lock_guard<nano::mutex> guard{ mutex };
return index.contains (hash);
}

nano::container_info nano::bounded_backlog::container_info () const
{
nano::lock_guard<nano::mutex> guard{ mutex };
Expand Down
2 changes: 1 addition & 1 deletion nano/node/bounded_backlog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class bounded_backlog

size_t index_size () const;
size_t bucket_threshold () const;
bool contains (nano::block_hash const &) const;

nano::container_info container_info () const;

Expand All @@ -133,7 +134,6 @@ class bounded_backlog
private:
void activate (nano::secure::transaction &, nano::account const &, nano::account_info const &, nano::confirmation_height_info const &);
void update (nano::secure::transaction const &, nano::block_hash const &);
bool erase (nano::secure::transaction const &, nano::account const &);
bool insert (nano::secure::transaction const &, nano::block const &);

bool predicate () const;
Expand Down

0 comments on commit 88465ac

Please sign in to comment.