Skip to content

Commit

Permalink
Round LRU time to nearest 32 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
RickiNano committed Oct 25, 2023
1 parent f30ec11 commit 74628b4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nano/node/scheduler/bucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ void nano::scheduler::bucket::pop ()

void nano::scheduler::bucket::push (uint64_t time, std::shared_ptr<nano::block> block)
{
queue.insert ({ time, block });
const uint64_t bitmask = ~0b11111;
uint64_t rounded_time = time & bitmask;

queue.insert ({ rounded_time, block });
if (queue.size () > maximum)
{
debug_assert (!queue.empty ());
Expand Down

0 comments on commit 74628b4

Please sign in to comment.