From 997094e5b7a3e7554e9df2890f73ae4fca92cb19 Mon Sep 17 00:00:00 2001 From: ankur12-1610 Date: Fri, 29 Aug 2025 11:40:40 +0530 Subject: [PATCH] resolve linting errors --- libp2p/discovery/bootstrap/bootstrap.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libp2p/discovery/bootstrap/bootstrap.py b/libp2p/discovery/bootstrap/bootstrap.py index 9bf4ef52..2bc79c5f 100644 --- a/libp2p/discovery/bootstrap/bootstrap.py +++ b/libp2p/discovery/bootstrap/bootstrap.py @@ -7,13 +7,14 @@ import trio from libp2p.abc import ID, INetworkService, PeerInfo from libp2p.discovery.bootstrap.utils import validate_bootstrap_addresses from libp2p.discovery.events.peerDiscovery import peerDiscovery +from libp2p.network.exceptions import SwarmException from libp2p.peer.peerinfo import info_from_p2p_addr from libp2p.peer.peerstore import PERMANENT_ADDR_TTL -from libp2p.network.exceptions import SwarmException logger = logging.getLogger("libp2p.discovery.bootstrap") resolver = DNSResolver() + class BootstrapDiscovery: """ Bootstrap-based peer discovery for py-libp2p. @@ -193,7 +194,9 @@ class BootstrapDiscovery: ) # Even for existing peers, try to connect if not already connected if peer_info.peer_id not in self.swarm.connections: - logger.debug("Starting parallel connection attempt for existing peer...") + logger.debug( + "Starting parallel connection attempt for existing peer..." + ) # Use nursery for parallel connection attempt (non-blocking) try: async with trio.open_nursery() as connection_nursery: @@ -248,7 +251,7 @@ class BootstrapDiscovery: ) # Use swarm.dial_peer to connect using stored addresses - connection = await self.swarm.dial_peer(peer_id) + await self.swarm.dial_peer(peer_id) # Calculate connection time connection_time = trio.current_time() - connection_start_time