mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
validate and filter bootstrap addresses during discovery initialization
This commit is contained in:
@ -3,6 +3,7 @@ import logging
|
||||
from multiaddr import Multiaddr
|
||||
|
||||
from libp2p.abc import INetworkService
|
||||
from libp2p.discovery.bootstrap.utils import validate_bootstrap_addresses
|
||||
from libp2p.discovery.events.peerDiscovery import peerDiscovery
|
||||
from libp2p.peer.peerinfo import info_from_p2p_addr
|
||||
|
||||
@ -28,6 +29,9 @@ class BootstrapDiscovery:
|
||||
f"{len(self.bootstrap_addrs)} bootstrap addresses"
|
||||
)
|
||||
|
||||
# Validate and filter bootstrap addresses
|
||||
self.bootstrap_addrs = validate_bootstrap_addresses(self.bootstrap_addrs)
|
||||
|
||||
for addr_str in self.bootstrap_addrs:
|
||||
try:
|
||||
self._process_bootstrap_addr(addr_str)
|
||||
|
||||
Reference in New Issue
Block a user