diff --git a/libp2p/kad_dht/peer_routing.py b/libp2p/kad_dht/peer_routing.py index 8e40ccf5..4bcdb647 100644 --- a/libp2p/kad_dht/peer_routing.py +++ b/libp2p/kad_dht/peer_routing.py @@ -60,7 +60,6 @@ class PeerRouting(IPeerRouting): """ self.host = host self.routing_table = routing_table - self.protocol_id = PROTOCOL_ID async def find_peer(self, peer_id: ID) -> PeerInfo | None: """ @@ -245,7 +244,7 @@ class PeerRouting(IPeerRouting): # Open a stream to the peer using the Kademlia protocol logger.debug(f"Opening stream to {peer} for closest peers query") try: - stream = await self.host.new_stream(peer, [self.protocol_id]) + stream = await self.host.new_stream(peer, [PROTOCOL_ID]) logger.debug(f"Stream opened to {peer}") except Exception as e: logger.warning(f"Failed to open stream to {peer}: {e}") diff --git a/tests/core/kad_dht/test_unit_peer_routing.py b/tests/core/kad_dht/test_unit_peer_routing.py index 72320b73..ffe20655 100644 --- a/tests/core/kad_dht/test_unit_peer_routing.py +++ b/tests/core/kad_dht/test_unit_peer_routing.py @@ -89,7 +89,6 @@ class TestPeerRouting: assert peer_routing.host == mock_host assert peer_routing.routing_table == mock_routing_table - assert peer_routing.protocol_id == PROTOCOL_ID @pytest.mark.trio async def test_find_peer_local_host(self, peer_routing, mock_host):