diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index 9086664a4..2356e10be 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -530,14 +530,8 @@ void Host::connect(std::shared_ptr const& _p) return; } - if (!!m_nodeTable && !m_nodeTable->haveNode(_p->id)) - { - // connect was attempted, so try again by adding to node table - m_nodeTable->addNode(*_p.get()); - // abort unless peer is required - if (!_p->required) - return; - } + if (!!m_nodeTable && !m_nodeTable->haveNode(_p->id) && !_p->required) + return; // prevent concurrently connecting to a node Peer *nptr = _p.get();