Immediately abort legacy bootstrap connections (#4879)

This commit is contained in:
Piotr Wójcik 2025-04-14 22:35:53 +02:00 committed by Piotr Wójcik
commit ce17b7969e
2 changed files with 1 additions and 54 deletions

View file

@ -238,11 +238,7 @@ auto nano::transport::tcp_server::process_message (std::unique_ptr<nano::message
// The server will switch to bootstrap mode immediately after processing the first bootstrap message, thus no `else if`
if (is_bootstrap_connection ())
{
bootstrap_message_visitor bootstrap_visitor{ shared_from_this () };
message->visit (bootstrap_visitor);
// Pause receiving new messages if bootstrap serving started
return bootstrap_visitor.processed ? process_result::pause : process_result::progress;
return process_result::abort;
}
debug_assert (false);
@ -503,39 +499,6 @@ void nano::transport::tcp_server::realtime_message_visitor::asc_pull_ack (const
process = true;
}
/*
* bootstrap_message_visitor
*/
nano::transport::tcp_server::bootstrap_message_visitor::bootstrap_message_visitor (std::shared_ptr<tcp_server> server) :
server{ std::move (server) }
{
}
void nano::transport::tcp_server::bootstrap_message_visitor::bulk_pull (const nano::bulk_pull & message)
{
// Ignored since V28
// TODO: Abort connection?
}
void nano::transport::tcp_server::bootstrap_message_visitor::bulk_pull_account (const nano::bulk_pull_account & message)
{
// Ignored since V28
// TODO: Abort connection?
}
void nano::transport::tcp_server::bootstrap_message_visitor::bulk_push (const nano::bulk_push &)
{
// Ignored since V28
// TODO: Abort connection?
}
void nano::transport::tcp_server::bootstrap_message_visitor::frontier_req (const nano::frontier_req & message)
{
// Ignored since V28
// TODO: Abort connection?
}
/*
*
*/

View file

@ -119,22 +119,6 @@ private: // Visitors
tcp_server & server;
};
class bootstrap_message_visitor : public nano::message_visitor
{
public:
bool processed{ false };
explicit bootstrap_message_visitor (std::shared_ptr<tcp_server>);
void bulk_pull (nano::bulk_pull const &) override;
void bulk_pull_account (nano::bulk_pull_account const &) override;
void bulk_push (nano::bulk_push const &) override;
void frontier_req (nano::frontier_req const &) override;
private:
std::shared_ptr<tcp_server> server;
};
friend class handshake_message_visitor;
};
}