def __init__(self, server: ChiaServer, root_path: Path, target_outbound_count: int, peer_db_path: str, introducer_info: Optional[Dict], dns_servers: List[str], peer_connect_interval: int, selected_network: str, default_port: Optional[int], log):
    self.server: ChiaServer = server
    self.message_queue: asyncio.Queue = asyncio.Queue()
    self.is_closed = False
    self.target_outbound_count = target_outbound_count
    if (selected_network != 'mainnet'):
        if (not peer_db_path.endswith('.sqlite')):
            raise ValueError(f'Invalid path for peer table db: {peer_db_path}. Make the path end with .sqlite')
        peer_db_path = (((peer_db_path[:(- 7)] + '_') + selected_network) + '.sqlite')
    self.peer_db_path = path_from_root(root_path, peer_db_path)
    self.dns_servers = dns_servers
    if (introducer_info is not None):
        self.introducer_info: Optional[PeerInfo] = PeerInfo(introducer_info['host'], introducer_info['port'])
    else:
        self.introducer_info = None
    self.peer_connect_interval = peer_connect_interval
    self.log = log
    self.relay_queue = None
    self.address_manager: Optional[AddressManager] = None
    self.connection_time_pretest: Dict = {}
    self.received_count_from_peers: Dict = {}
    self.lock = asyncio.Lock()
    self.connect_peers_task: Optional[asyncio.Task] = None
    self.serialize_task: Optional[asyncio.Task] = None
    self.cleanup_task: Optional[asyncio.Task] = None
    self.initial_wait: int = 0
    try:
        self.resolver: Optional[dns.asyncresolver.Resolver] = dns.asyncresolver.Resolver()
    except Exception:
        self.resolver = None
        self.log.exception('Error initializing asyncresolver')
    self.pending_outbound_connections: Set[str] = set()
    self.pending_tasks: Set[asyncio.Task] = set()
    self.default_port: Optional[int] = default_port
    if ((default_port is None) and (selected_network in NETWORK_ID_DEFAULT_PORTS)):
        self.default_port = NETWORK_ID_DEFAULT_PORTS[selected_network]
def __init__(self, server: ChiaServer, root_path: Path, target_outbound_count: int, peer_db_path: str, introducer_info: Optional[Dict], dns_servers: List[str], peer_connect_interval: int, selected_network: str, default_port: Optional[int], log):
    self.server: ChiaServer = server
    self.message_queue: asyncio.Queue = asyncio.Queue()
    self.is_closed = False
    self.target_outbound_count = target_outbound_count
    if (selected_network != 'mainnet'):
        if (not peer_db_path.endswith('.sqlite')):
            raise ValueError(f'Invalid path for peer table db: {peer_db_path}. Make the path end with .sqlite')
        peer_db_path = (((peer_db_path[:(- 7)] + '_') + selected_network) + '.sqlite')
    self.peer_db_path = path_from_root(root_path, peer_db_path)
    self.dns_servers = dns_servers
    if (introducer_info is not None):
        self.introducer_info: Optional[PeerInfo] = PeerInfo(introducer_info['host'], introducer_info['port'])
    else:
        self.introducer_info = None
    self.peer_connect_interval = peer_connect_interval
    self.log = log
    self.relay_queue = None
    self.address_manager: Optional[AddressManager] = None
    self.connection_time_pretest: Dict = {}
    self.received_count_from_peers: Dict = {}
    self.lock = asyncio.Lock()
    self.connect_peers_task: Optional[asyncio.Task] = None
    self.serialize_task: Optional[asyncio.Task] = None
    self.cleanup_task: Optional[asyncio.Task] = None
    self.initial_wait: int = 0
    try:
        self.resolver: Optional[dns.asyncresolver.Resolver] = dns.asyncresolver.Resolver()
    except Exception:
        self.resolver = None
        self.log.exception('Error initializing asyncresolver')
    self.pending_outbound_connections: Set[str] = set()
    self.pending_tasks: Set[asyncio.Task] = set()
    self.default_port: Optional[int] = default_port
    if ((default_port is None) and (selected_network in NETWORK_ID_DEFAULT_PORTS)):
        self.default_port = NETWORK_ID_DEFAULT_PORTS[selected_network]