From db12fc1d83c534e68c83daceb5ee46f236b0594e Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 15:28:19 +0200 Subject: [PATCH] Don't abort connecting to required peer when it's not in node table. --- libp2p/Host.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index 9c3e629d4..e2599c1d5 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -475,9 +475,11 @@ void Host::connect(std::shared_ptr const& _p) if (!!m_nodeTable && !m_nodeTable->haveNode(_p->id)) { - clog(NetWarn) << "Aborted connect. Node not in node table."; + // connect was attempted, so try again by adding to node table m_nodeTable->addNode(*_p.get()); - return; + // abort unless peer is required + if (!_p->required) + return; } // prevent concurrently connecting to a node