Remove TorProcessManager.Mock() method.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -123,7 +123,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
}
}
- return new PayjoinClient(payjoinEndPointUri, Global.TorManager.TorSocks5EndPoint);
+ return new PayjoinClient(payjoinEndPointUri, Global.TorSocks5EndPoint);
}
return null;

MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -66,7 +66,8 @@ namespace WalletWasabi.Gui
public TransactionBroadcaster TransactionBroadcaster { get; set; }
public CoinJoinProcessor CoinJoinProcessor { get; set; }
public Node RegTestMempoolServingNode { get; private set; }
- public TorProcessManager TorManager { get; private set; }
+ public EndPoint? TorSocks5EndPoint { get; private set; }
+ private TorProcessManager? TorManager { get; set; }
public CoreNode BitcoinCoreNode { get; private set; }
public HostedServices HostedServices { get; }
@@ -135,7 +136,6 @@ namespace WalletWasabi.Gui
{
InitializationStarted = true;
AddressManager = null;
- TorManager = null;
var cancel = StoppingCts.Token;
try
@@ -177,15 +177,15 @@ namespace WalletWasabi.Gui
if (Config.UseTor)
{
- TorManager = new TorProcessManager(Config.TorSocks5EndPoint, TorLogsFile);
- TorManager.Start(ensureRunning: false, DataDir);
+ TorManager = new TorProcessManager(Config.TorSocks5EndPoint, DataDir, TorLogsFile);
+ TorManager.Start(ensureRunning: false);
var fallbackRequestTestUri = new Uri(Config.GetFallbackBackendUri(), "/api/software/versions");
- TorManager.StartMonitor(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(7), DataDir, fallbackRequestTestUri);
+ TorManager.StartMonitor(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(7), fallbackRequestTestUri);
}
else
{
- TorManager = TorProcessManager.Mock();
+ TorSocks5EndPoint = null;
}
Logger.LogInfo($"{nameof(TorProcessManager)} is initialized.");

MODIFY
WalletWasabi/TorSocks5/TorProcessManager.cs
WalletWasabi/TorSocks5/TorProcessManager.cs
@@ -36,10 +36,7 @@ namespace WalletWasabi.TorSocks5
TorProcess = null;
}
- /// <summary>
- /// If null then it's just a mock, clearnet is used.
- /// </summary>
- public EndPoint TorSocks5EndPoint { get; }
+ private EndPoint TorSocks5EndPoint { get; }
public string LogFile { get; }
@@ -53,11 +50,6 @@ namespace WalletWasabi.TorSocks5
private CancellationTokenSource Stop { get; set; }
- public static TorProcessManager Mock() // Mock, do not use Tor at all for debug.
- {
- return new TorProcessManager(null, null, null);
- }
-
public void Start(bool ensureRunning)
{
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)

Remove TorProcessManager.Mock() method.