`TorMonitor`: Make it shorter
MODIFY
WalletWasabi/Tor/TorMonitor.cs
WalletWasabi/Tor/TorMonitor.cs
@@ -94,22 +94,17 @@ public class TorMonitor : PeriodicRunner
}
else if (asyncEvent is StatusEvent statusEvent)
{
- if (statusEvent.Action == StatusEvent.ActionCircuitEstablished)
- {
- if (!circuitEstablished)
+ if (!circuitEstablished && statusEvent.Action == StatusEvent.ActionCircuitEstablished)
{
Logger.LogInfo("Tor circuit was established.");
circuitEstablished = true;
}
}
- }
else if (asyncEvent is CircEvent circEvent)
{
CircuitInfo info = circEvent.CircuitInfo;
- if (info.CircStatus is CircStatus.BUILT or CircStatus.EXTENDED or CircStatus.GUARD_WAIT)
- {
- if (!circuitEstablished)
+ if (!circuitEstablished && info.CircStatus is CircStatus.BUILT or CircStatus.EXTENDED or CircStatus.GUARD_WAIT)
{
Logger.LogInfo("Tor circuit was established.");
circuitEstablished = true;
@@ -117,7 +112,6 @@ public class TorMonitor : PeriodicRunner
}
}
}
- }
catch (OperationCanceledException)
{
if (linkedCts.IsCancellationRequested)

`TorMonitor`: Make it shorter