Start Tor monitor only if Config.UseTor is true.
This commit does not change behavior in any way. It simplifies it only.
MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -177,17 +177,17 @@ namespace WalletWasabi.Gui
if (Config.UseTor)
{
- TorManager = new TorProcessManager(Config.TorSocks5EndPoint, DataDir, TorLogsFile);
- TorManager.Start(ensureRunning: false);
+ TorManager = new TorProcessManager(Config.TorSocks5EndPoint, TorLogsFile);
+ TorManager.Start(ensureRunning: false, DataDir);
+
+ var fallbackRequestTestUri = new Uri(Config.GetFallbackBackendUri(), "/api/software/versions");
+ TorManager.StartMonitor(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(7), DataDir, fallbackRequestTestUri);
}
else
{
TorManager = TorProcessManager.Mock();
}
- var fallbackRequestTestUri = new Uri(Config.GetFallbackBackendUri(), "/api/software/versions");
- TorManager.StartMonitor(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(7), fallbackRequestTestUri);
-
Logger.LogInfo($"{nameof(TorProcessManager)} is initialized.");
#endregion TorProcessInitialization

MODIFY
WalletWasabi/TorSocks5/TorProcessManager.cs
WalletWasabi/TorSocks5/TorProcessManager.cs
@@ -60,11 +60,6 @@ namespace WalletWasabi.TorSocks5
public void Start(bool ensureRunning)
{
- if (TorSocks5EndPoint is null)
- {
- return;
- }
-
new Thread(delegate () // Do not ask. This is the only way it worked on Win10/Ubuntu18.04/Manjuro(1 processor VM)/Fedora(1 processor VM)
{
try
@@ -214,11 +209,6 @@ namespace WalletWasabi.TorSocks5
public void StartMonitor(TimeSpan torMisbehaviorCheckPeriod, TimeSpan checkIfRunningAfterTorMisbehavedFor, Uri fallBackTestRequestUri)
{
- if (TorSocks5EndPoint is null)
- {
- return;
- }
-
Logger.LogInfo("Starting Tor monitor...");
if (Interlocked.CompareExchange(ref _running, 1, 0) != 0)
{

Start Tor monitor only if Config.UseTor is true.

This commit does not change behavior in any way. It simplifies it only.