Unwrap instead of adding consumer complexity
MODIFY
WalletWasabi/Tor/Socks5/Pool/TorHttpPool.cs
WalletWasabi/Tor/Socks5/Pool/TorHttpPool.cs
@@ -83,8 +83,15 @@ public class TorHttpPool : IDisposable
TorDoesntWorkSince = DateTimeOffset.UtcNow;
}
+ if (e is HttpRequestException)
+ {
+ LatestTorException = e.InnerException is null ? e : e.InnerException;
+ }
+ else
+ {
LatestTorException = e;
}
+ }
/// <summary>
/// Sends an HTTP(s) request.

MODIFY
WalletWasabi/Tor/TorMonitor.cs
WalletWasabi/Tor/TorMonitor.cs
@@ -146,7 +146,7 @@ public class TorMonitor : PeriodicRunner
if (torMisbehavedFor > CheckIfRunningAfterTorMisbehavedFor)
{
- if (TorHttpPool.LatestTorException is TorConnectCommandFailedException || TorHttpPool.LatestTorException?.InnerException is TorConnectCommandFailedException)
+ if (TorHttpPool.LatestTorException is TorConnectCommandFailedException)
{
// Tor must be running for us to consider switching to the fallback address.
bool isRunning = await HttpClient.IsTorRunningAsync().ConfigureAwait(false);

Unwrap instead of adding consumer complexity