Skip to content

Commit

Permalink
Restore version-based protocols selection.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Feb 24, 2024
1 parent 8e530f7 commit ac0ebd8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 30 deletions.
32 changes: 16 additions & 16 deletions include/bitcoin/node/sessions/attach.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,28 +58,28 @@ class attach
const network::channel::ptr& channel) NOEXCEPT override
{
auto& self = *this;
////const auto version = channel->negotiated_version();
const auto version = channel->negotiated_version();
////constexpr auto performance = false;

// Attach appropriate alert, reject, ping, and/or address protocols.
Session::attach_protocols(channel);

// Very hard to find < 31800 peer to connect with.
////if (version >= network::messages::level::bip130)
////{
//// // Headers-first synchronization (parallel block download).
//// channel->attach<protocol_header_in_70012>(self)->start();
//// channel->attach<protocol_header_out_70012>(self)->start();
//// ////channel->attach<protocol_block_in_31800>(self, performance)->start();
////}
////else if (version >= network::messages::level::headers_protocol)
////{
//// // Headers-first synchronization (parallel block download).
//// channel->attach<protocol_header_in_31800>(self)->start();
//// channel->attach<protocol_header_out_31800>(self)->start();
//// ////channel->attach<protocol_block_in_31800>(self, performance)->start();
////}
////else
if (version >= network::messages::level::bip130)
{
// Headers-first synchronization (parallel block download).
channel->attach<protocol_header_in_70012>(self)->start();
channel->attach<protocol_header_out_70012>(self)->start();
////channel->attach<protocol_block_in_31800>(self, performance)->start();
}
else if (version >= network::messages::level::headers_protocol)
{
// Headers-first synchronization (parallel block download).
channel->attach<protocol_header_in_31800>(self)->start();
channel->attach<protocol_header_out_31800>(self)->start();
////channel->attach<protocol_block_in_31800>(self, performance)->start();
}
else
{
// Blocks-first synchronization (no header protocol).
channel->attach<protocol_block_in>(self)->start();
Expand Down
28 changes: 14 additions & 14 deletions src/sessions/session_outbound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,26 +96,26 @@ void session_outbound::attach_protocols(
const network::channel::ptr& channel) NOEXCEPT
{
auto& self = *this;
////const auto version = channel->negotiated_version();
const auto version = channel->negotiated_version();
////constexpr auto performance = true;

// Attach appropriate alert, reject, ping, and/or address protocols.
network::session_outbound::attach_protocols(channel);

// Very hard to find < 31800 peer to connect with.
////if (version >= network::messages::level::bip130)
////{
//// channel->attach<protocol_header_in_70012>(self)->start();
//// channel->attach<protocol_header_out_70012>(self)->start();
//// ////channel->attach<protocol_block_in_31800>(self, performance)->start();
////}
////else if (version >= network::messages::level::headers_protocol)
////{
//// channel->attach<protocol_header_in_31800>(self)->start();
//// channel->attach<protocol_header_out_31800>(self)->start();
//// ////channel->attach<protocol_block_in_31800>(self, performance)->start();
////}
////else
if (version >= network::messages::level::bip130)
{
channel->attach<protocol_header_in_70012>(self)->start();
channel->attach<protocol_header_out_70012>(self)->start();
////channel->attach<protocol_block_in_31800>(self, performance)->start();
}
else if (version >= network::messages::level::headers_protocol)
{
channel->attach<protocol_header_in_31800>(self)->start();
channel->attach<protocol_header_out_31800>(self)->start();
////channel->attach<protocol_block_in_31800>(self, performance)->start();
}
else
{
// Blocks-first synchronization (no header protocol).
channel->attach<protocol_block_in>(self)->start();
Expand Down

0 comments on commit ac0ebd8

Please sign in to comment.