This commit is contained in:
Piotr Wójcik 2024-02-09 18:52:16 +01:00
commit f6a32c98d6
3 changed files with 12 additions and 12 deletions

View file

@ -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);

View file

@ -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);
{
@ -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 ());
@ -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");
}

View file

@ -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);
/**
@ -99,7 +99,7 @@ private:
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;