Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Feb 10, 2024
1 parent 9a80f29 commit f6a32c9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion nano/node/block_broadcast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void nano::block_broadcast::observe (std::shared_ptr<nano::block> const & block,
}
else
{
if (context.source != nano::block_source::bootstrap)
if (context.source != nano::block_source::bootstrap && context.source != nano::block_source::bootstrap_legacy)
{
// Block arrived from realtime traffic, do normal gossip.
network.flood_block (block, nano::transport::buffer_drop_policy::limiter);
Expand Down
18 changes: 9 additions & 9 deletions nano/node/blockprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ bool nano::block_processor::have_blocks ()
return have_blocks_ready ();
}

void nano::block_processor::add_impl (std::shared_ptr<nano::block> block, context ctx)
void nano::block_processor::add_impl (std::shared_ptr<nano::block> const & block, context ctx)
{
release_assert (ctx.source != nano::block_source::forced);
{
Expand All @@ -237,14 +237,6 @@ auto nano::block_processor::next () -> entry
debug_assert (!mutex.try_lock ());
debug_assert (!blocks.empty () || !forced.empty ()); // This should be checked before calling next

if (!blocks.empty ())
{
entry entry = std::move (blocks.front ());
release_assert (entry.ctx.source != nano::block_source::forced);
blocks.pop_front ();
return entry;
}

if (!forced.empty ())
{
entry entry = std::move (forced.front ());
Expand All @@ -253,6 +245,14 @@ auto nano::block_processor::next () -> entry
return entry;
}

if (!blocks.empty ())
{
entry entry = std::move (blocks.front ());
release_assert (entry.ctx.source != nano::block_source::forced);
blocks.pop_front ();
return entry;
}

release_assert (false, "next() called when no blocks are ready");
}

Expand Down
4 changes: 2 additions & 2 deletions nano/node/blockprocessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum class block_source
forced,
};

std::string_view to_string (nano::block_source);
std::string_view to_string (block_source);
nano::stat::detail to_stat_detail (block_source);

/**
Expand Down Expand Up @@ -99,7 +99,7 @@ class block_processor final
void queue_unchecked (store::write_transaction const &, nano::hash_or_account const &);
processed_batch_t process_batch (nano::unique_lock<nano::mutex> &);
entry next ();
void add_impl (std::shared_ptr<nano::block> block, context);
void add_impl (std::shared_ptr<nano::block> const & block, context);

private: // Dependencies
nano::node & node;
Expand Down

0 comments on commit f6a32c9

Please sign in to comment.