Optimize wait
MODIFY
WalletWasabi/Services/IndexDownloader.cs
WalletWasabi/Services/IndexDownloader.cs
@@ -293,6 +293,18 @@ namespace WalletWasabi.Services
// 3. Skip the last valid block.
continue;
}
+ catch (ConnectionException ex)
+ {
+ Logger.LogDebug<CcjClient>(ex);
+ try
+ {
+ await Task.Delay(3000, Cancel.Token); // Give other threads time to do stuff.
+ }
+ catch (TaskCanceledException ex2)
+ {
+ Logger.LogTrace<CcjClient>(ex2);
+ }
+ }
catch (Exception ex)
{
Logger.LogError<IndexDownloader>(ex);
@@ -310,17 +322,6 @@ namespace WalletWasabi.Services
Logger.LogTrace<CcjClient>(ex);
}
}
- else if (!IsRunning)
- {
- try
- {
- await Task.Delay(3000, Cancel.Token); // Give other threads time to do stuff.
- }
- catch (TaskCanceledException ex)
- {
- Logger.LogTrace<CcjClient>(ex);
- }
- }
}
}
}

MODIFY
WalletWasabi/Services/UpdateChecker.cs
WalletWasabi/Services/UpdateChecker.cs
@@ -4,6 +4,7 @@ using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using WalletWasabi.Exceptions;
using WalletWasabi.Logging;
using WalletWasabi.WebClients.Wasabi;
@@ -63,6 +64,18 @@ namespace WalletWasabi.Services
{
Logger.LogTrace<UpdateChecker>(ex);
}
+ catch (ConnectionException ex)
+ {
+ Logger.LogDebug<UpdateChecker>(ex);
+ try
+ {
+ await Task.Delay(period, Stop.Token); // Give other threads time to do stuff, update check is not crucial.
+ }
+ catch (TaskCanceledException ex2)
+ {
+ Logger.LogTrace<UpdateChecker>(ex2);
+ }
+ }
catch (Exception ex)
{
Logger.LogDebug<UpdateChecker>(ex);

Optimize wait