Try thread.start
MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -87,10 +87,7 @@ namespace WalletWasabi.Gui
TorManager = null;
TorManager = new TorProcessManager(Config.GetTorSocks5EndPoint(), TorLogsFile);
- new Thread(delegate () // Don't ask. This is the only way it worked on Win10/Ubuntu18.04/Manjuro(1 processor VM)/Fedora(1 processor VM)
- {
- TorManager.StartAsync(ensureRunning: false).GetAwaiter().GetResult();
- }).Start();
+ TorManager.Start(false);
Logger.LogInfo<TorProcessManager>($"Fake {nameof(TorProcessManager)} is initialized.");

MODIFY
WalletWasabi.Tests/LiveServerTests.cs
WalletWasabi.Tests/LiveServerTests.cs
@@ -30,11 +30,8 @@ namespace WalletWasabi.Tests
LiveServerTestsFixture = liveServerTestsFixture;
var torManager = new TorProcessManager(SharedFixture.TorSocks5Endpoint, SharedFixture.TorLogsFile);
- new Thread(delegate () // Don't ask. This is the only way it worked on Win10/Ubuntu18.04/Manjuro(1 processor VM)/Fedora(1 processor VM)
- {
- torManager.StartAsync(ensureRunning: false).GetAwaiter().GetResult();
- }).Start();
- Thread.Sleep(3000);
+ torManager.Start(ensureRunning: true);
+ Task.Delay(3000).GetAwaiter().GetResult();
}
#region Blockchain

MODIFY
WalletWasabi.Tests/TorTests.cs
WalletWasabi.Tests/TorTests.cs
@@ -19,7 +19,8 @@ namespace WalletWasabi.Tests
{
SharedFixture = sharedFixture;
var torManager = new TorProcessManager(SharedFixture.TorSocks5Endpoint, SharedFixture.TorLogsFile);
- torManager.StartAsync(false).GetAwaiter().GetResult();
+ torManager.Start(ensureRunning: true);
+ Task.Delay(3000).GetAwaiter().GetResult();
}
[Fact]

MODIFY
WalletWasabi/TorSocks5/TorProcessManager.cs
WalletWasabi/TorSocks5/TorProcessManager.cs
@@ -27,7 +27,9 @@ namespace WalletWasabi.TorSocks5
LogFile = logFile;
}
- public async Task StartAsync(bool ensureRunning)
+ public void Start(bool ensureRunning)
+ {
+ new Thread(delegate () // Don't ask. This is the only way it worked on Win10/Ubuntu18.04/Manjuro(1 processor VM)/Fedora(1 processor VM)
{
try
{
@@ -38,7 +40,7 @@ namespace WalletWasabi.TorSocks5
try
{
- if (await IsTorRunningAsync(TorSocks5EndPoint))
+ if (IsTorRunningAsync(TorSocks5EndPoint).GetAwaiter().GetResult())
{
Logger.LogInfo<TorProcessManager>("Tor is already running.");
return;
@@ -71,13 +73,13 @@ namespace WalletWasabi.TorSocks5
string torDaemonsDir = Path.Combine(fullBaseDirectory, "TorDaemons");
string dataZip = Path.Combine(torDaemonsDir, "data-folder.zip");
- await IoHelpers.BetterExtractZipToDirectoryAsync(dataZip, torDir);
+ IoHelpers.BetterExtractZipToDirectoryAsync(dataZip, torDir).GetAwaiter().GetResult();
Logger.LogInfo<TorProcessManager>($"Extracted {dataZip} to {torDir}.");
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
string torWinZip = Path.Combine(torDaemonsDir, "tor-win32.zip");
- await IoHelpers.BetterExtractZipToDirectoryAsync(torWinZip, torDir);
+ IoHelpers.BetterExtractZipToDirectoryAsync(torWinZip, torDir).GetAwaiter().GetResult();
Logger.LogInfo<TorProcessManager>($"Extracted {torWinZip} to {torDir}.");
}
else // Linux or OSX
@@ -93,13 +95,13 @@ namespace WalletWasabi.TorSocks5
{
torLinuxZip = Path.Combine(torDaemonsDir, "tor-linux64.zip");
}
- await IoHelpers.BetterExtractZipToDirectoryAsync(torLinuxZip, torDir);
+ IoHelpers.BetterExtractZipToDirectoryAsync(torLinuxZip, torDir).GetAwaiter().GetResult();
Logger.LogInfo<TorProcessManager>($"Extracted {torLinuxZip} to {torDir}.");
}
else // OSX
{
string torOsxZip = Path.Combine(torDaemonsDir, "tor-osx64.zip");
- await IoHelpers.BetterExtractZipToDirectoryAsync(torOsxZip, torDir);
+ IoHelpers.BetterExtractZipToDirectoryAsync(torOsxZip, torDir).GetAwaiter().GetResult();
Logger.LogInfo<TorProcessManager>($"Extracted {torOsxZip} to {torDir}.");
}
@@ -143,8 +145,8 @@ namespace WalletWasabi.TorSocks5
if (ensureRunning)
{
- await Task.Delay(3000).ConfigureAwait(false); // dotnet brainfart, ConfigureAwait(false) IS NEEDED HERE otherwise (only on) Manjuro Linux fails, WTF?!!
- if (!await IsTorRunningAsync(TorSocks5EndPoint))
+ Task.Delay(3000).ConfigureAwait(false).GetAwaiter().GetResult(); // dotnet brainfart, ConfigureAwait(false) IS NEEDED HERE otherwise (only on) Manjuro Linux fails, WTF?!!
+ if (!IsTorRunningAsync(TorSocks5EndPoint).GetAwaiter().GetResult())
{
throw new TorException("Attempted to start Tor, but it is not running.");
}
@@ -160,6 +162,7 @@ namespace WalletWasabi.TorSocks5
{
Logger.LogError<TorProcessManager>(ex);
}
+ }).Start();
}
/// <param name="torSocks5EndPoint">Opt out Tor with null.</param>

Try thread.start