@@ -519,8 +519,9 @@ def _init_parameters_from_config(self) -> None:
519
519
self .auto_connect = self .config .NETWORK_AUTO_CONNECT
520
520
if self .auto_connect and self .config .NETWORK_ONESERVER :
521
521
# enabling both oneserver and auto_connect doesn't really make sense
522
- # assume oneserver is enabled for privacy reasons, disable auto_connect
523
- self .logger .warning (f'both "oneserver" and "auto_connect" options enabled, disabling "auto_connect".' )
522
+ # assume oneserver is enabled for privacy reasons, disable auto_connect and assume server is unpredictable
523
+ self .logger .warning (f'both "oneserver" and "auto_connect" options enabled, disabling "auto_connect" and resetting "server".' )
524
+ self .config .NETWORK_SERVER = "" # let _set_default_server set harmless default (localhost)
524
525
self .auto_connect = False
525
526
526
527
self ._set_default_server ()
@@ -695,14 +696,8 @@ async def set_parameters(self, net_params: NetworkParameters):
695
696
int (proxy ['port' ])
696
697
except Exception :
697
698
return
698
- auto_connect = net_params .auto_connect
699
- if auto_connect and net_params .oneserver :
700
- # enabling both oneserver and auto_connect doesn't really make sense
701
- # assume oneserver is enabled for privacy reasons, disable auto_connect
702
- self .logger .warning (f'both "oneserver" and "auto_connect" options enabled, disabling "auto_connect".' )
703
- auto_connect = False
704
699
705
- self .config .NETWORK_AUTO_CONNECT = auto_connect
700
+ self .config .NETWORK_AUTO_CONNECT = net_params . auto_connect
706
701
self .config .NETWORK_ONESERVER = net_params .oneserver
707
702
self .config .NETWORK_PROXY = proxy_str
708
703
self .config .NETWORK_PROXY_USER = proxy_user
0 commit comments