This repository was archived by the owner on Oct 28, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -594,10 +594,9 @@ void Host::requirePeer(NodeID const& _nodeID, NodeIPEndpoint const& _endpoint)
594594 return ;
595595 }
596596
597-
598597 {
599598 Guard l (x_requiredPeers);
600- m_requiredPeers.insert (_n );
599+ m_requiredPeers.insert (_nodeID );
601600 }
602601
603602 Node node (_nodeID, _endpoint, PeerType::Required);
@@ -615,7 +614,7 @@ void Host::requirePeer(NodeID const& _nodeID, NodeIPEndpoint const& _endpoint)
615614 }
616615 }
617616 // required for discovery
618- addNodeToNodeTable (*p );
617+ addNodeToNodeTable (*peer );
619618}
620619
621620bool Host::isRequiredPeer (NodeID const & _id) const
@@ -1118,3 +1117,13 @@ void Host::forEachPeer(
11181117 return ;
11191118}
11201119
1120+ std::shared_ptr<Peer> Host::findPeer (
1121+ NodeID const & _nodeID, bi::address const & _address, unsigned short _tcpPort) const
1122+ {
1123+ auto const itPeer = m_peers.find (_nodeID);
1124+ if (itPeer != m_peers.end () && itPeer->second ->endpoint .address () == _address &&
1125+ itPeer->second ->endpoint .tcpPort () == _tcpPort)
1126+ return itPeer->second ;
1127+
1128+ return {};
1129+ }
You can’t perform that action at this time.
0 commit comments