Remove UDP cleanups, UDP/TCP conversions from tcp_channels
This commit is contained in:
parent
b159d49f9e
commit
3449634fac
1 changed files with 0 additions and 18 deletions
|
|
@ -141,10 +141,6 @@ bool nano::transport::tcp_channels::insert (std::shared_ptr<nano::transport::cha
|
|||
error = false;
|
||||
lock.unlock ();
|
||||
node.network.channel_observer (channel_a);
|
||||
// Remove UDP channel to same IP:port if exists
|
||||
node.network.udp_channels.erase (udp_endpoint);
|
||||
// Remove UDP channels with same node ID
|
||||
node.network.udp_channels.clean_node_id (node_id);
|
||||
}
|
||||
}
|
||||
return error;
|
||||
|
|
@ -490,20 +486,6 @@ void nano::transport::tcp_channels::ongoing_keepalive ()
|
|||
{
|
||||
channel->send (message);
|
||||
}
|
||||
// Attempt to start TCP connections to known UDP peers
|
||||
nano::tcp_endpoint invalid_endpoint (boost::asio::ip::address_v6::any (), 0);
|
||||
if (!node.network_params.network.is_dev_network () && !node.flags.disable_udp)
|
||||
{
|
||||
std::size_t random_count (std::min (static_cast<std::size_t> (6), static_cast<std::size_t> (std::ceil (std::sqrt (node.network.udp_channels.size ())))));
|
||||
for (auto i (0); i <= random_count; ++i)
|
||||
{
|
||||
auto tcp_endpoint (node.network.udp_channels.bootstrap_peer (node.network_params.network.protocol_version_min));
|
||||
if (tcp_endpoint != invalid_endpoint && find_channel (tcp_endpoint) == nullptr && !node.network.excluded_peers.check (tcp_endpoint))
|
||||
{
|
||||
start_tcp (nano::transport::map_tcp_to_endpoint (tcp_endpoint));
|
||||
}
|
||||
}
|
||||
}
|
||||
std::weak_ptr<nano::node> node_w (node.shared ());
|
||||
node.workers.add_timed_task (std::chrono::steady_clock::now () + node.network_params.network.keepalive_period, [node_w] () {
|
||||
if (auto node_l = node_w.lock ())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue