Clarify current state of the Tor process.
MODIFY
WalletWasabi/Tor/TorMonitor.cs
WalletWasabi/Tor/TorMonitor.cs
@@ -49,7 +49,7 @@ namespace WalletWasabi.Tor
Uri baseUri = new Uri($"{FallBackTestRequestUri.Scheme}://{FallBackTestRequestUri.DnsSafeHost}");
using (var client = new TorHttpClient(baseUri, TorSocks5EndPoint))
{
- var message = new HttpRequestMessage(HttpMethod.Get, FallBackTestRequestUri);
+ using HttpRequestMessage message = new(HttpMethod.Get, FallBackTestRequestUri);
await client.SendAsync(message, token).ConfigureAwait(false);
}
@@ -62,6 +62,10 @@ namespace WalletWasabi.Tor
}
}
else
+ {
+ bool isRunning = await TorProcessManager.IsTorRunningAsync().ConfigureAwait(false);
+
+ if (!isRunning)
{
Logger.LogInfo($"Tor did not work properly for {(int)torMisbehavedFor.TotalSeconds} seconds. Maybe it crashed. Attempting to start it...");
@@ -70,6 +74,11 @@ namespace WalletWasabi.Tor
Logger.LogInfo($"Tor re-starting attempt {(started ? "succeeded." : "FAILED. Will try again later.")}");
}
+ else
+ {
+ Logger.LogInfo($"Tor is running. Waiting for a confirmation that HTTP requests can pass through.");
+ }
+ }
}
}
}

MODIFY
WalletWasabi/Tor/TorProcessManager.cs
WalletWasabi/Tor/TorProcessManager.cs
@@ -42,6 +42,11 @@ namespace WalletWasabi.Tor
private bool _disposed = false;
+ public Task<bool> IsTorRunningAsync()
+ {
+ return TorSocks5Client.IsTorRunningAsync();
+ }
+
/// <summary>
/// Starts Tor process if it is not running already.
/// </summary>

Clarify current state of the Tor process.