Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Mar 5, 2024
1 parent 0ddc5db commit 3f91e03
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions nano/node/blockprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ nano::block_processor::block_processor (nano::node & node_a, nano::write_databas
switch (origin.source)
{
case nano::block_source::live:
debug_assert (origin.channel != nullptr); // Live blocks should always be associated with a channel
return 128;
default:
return 1024 * 16;
Expand Down
4 changes: 3 additions & 1 deletion nano/node/fair_queue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ class fair_queue final
}

/// Should be called periodically to clean up stale channels
void periodic_cleanup (std::chrono::milliseconds interval = std::chrono::milliseconds{ 1000 * 30 })
bool periodic_cleanup (std::chrono::milliseconds interval = std::chrono::milliseconds{ 1000 * 30 })
{
if (elapsed (last_cleanup, interval))
{
last_cleanup = std::chrono::steady_clock::now ();
cleanup ();
return true; // Cleaned up
}
return false; // Not cleaned up
}

bool push (Request request, Source source, std::shared_ptr<nano::transport::channel> channel = nullptr)
Expand Down

0 comments on commit 3f91e03

Please sign in to comment.