Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Commit

Permalink
Fix build after rebase.
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed May 28, 2019
1 parent 7924165 commit 10f7e4b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions libp2p/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,9 @@ void Host::requirePeer(NodeID const& _nodeID, NodeIPEndpoint const& _endpoint)
return;
}


{
Guard l(x_requiredPeers);
m_requiredPeers.insert(_n);
m_requiredPeers.insert(_nodeID);
}

Node node(_nodeID, _endpoint, PeerType::Required);
Expand All @@ -615,7 +614,7 @@ void Host::requirePeer(NodeID const& _nodeID, NodeIPEndpoint const& _endpoint)
}
}
// required for discovery
addNodeToNodeTable(*p);
addNodeToNodeTable(*peer);
}

bool Host::isRequiredPeer(NodeID const& _id) const
Expand Down Expand Up @@ -1118,3 +1117,13 @@ void Host::forEachPeer(
return;
}

std::shared_ptr<Peer> Host::findPeer(
NodeID const& _nodeID, bi::address const& _address, unsigned short _tcpPort) const
{
auto const itPeer = m_peers.find(_nodeID);
if (itPeer != m_peers.end() && itPeer->second->endpoint.address() == _address &&
itPeer->second->endpoint.tcpPort() == _tcpPort)
return itPeer->second;

return {};
}

0 comments on commit 10f7e4b

Please sign in to comment.