diff --git a/nano/node/node.cpp b/nano/node/node.cpp index c3dde6cfee..43d2b87ac6 100644 --- a/nano/node/node.cpp +++ b/nano/node/node.cpp @@ -1116,15 +1116,22 @@ void nano::node::add_initial_peers () return; } - auto transaction (store.tx_begin_read ()); - for (auto i (store.peer.begin (transaction)), n (store.peer.end ()); i != n; ++i) + std::vector initial_peers; { - nano::endpoint endpoint (boost::asio::ip::address_v6 (i->first.address_bytes ()), i->first.port ()); - if (network.track_reachout (endpoint)) + auto transaction = store.tx_begin_read (); + for (auto i (store.peer.begin (transaction)), n (store.peer.end ()); i != n; ++i) { - network.tcp_channels.start_tcp (endpoint); + nano::endpoint endpoint (boost::asio::ip::address_v6 (i->first.address_bytes ()), i->first.port ()); + initial_peers.push_back (endpoint); } } + + logger.info (nano::log::type::node, "Adding cached initial peers: {}", initial_peers.size ()); + + for (auto const & peer : initial_peers) + { + network.merge_peer (peer); + } } void nano::node::start_election (std::shared_ptr const & block)