Browse Source

Merge pull request #2809 from gluk256/_require_peer

required peers are not added to the node table
cl-refactor
Gav Wood 10 years ago
parent
commit
d57ee72ec3
  1. 10
      libp2p/Host.cpp

10
libp2p/Host.cpp

@ -530,14 +530,8 @@ void Host::connect(std::shared_ptr<Peer> 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();

Loading…
Cancel
Save