Add missing .ConfigureAwait(false) to Global.cs
MODIFY
WalletWasabi.Gui/Global.cs
WalletWasabi.Gui/Global.cs
@@ -190,7 +190,7 @@ namespace WalletWasabi.Gui
#region BitcoinStoreInitialization
- await bstoreInitTask;
+ await bstoreInitTask.ConfigureAwait(false);
// Make sure that the height of the wallets will not be better than the current height of the filters.
WalletManager.SetMaxBestHeight(BitcoinStore.IndexStore.SmartHeaderChain.TipHeight);
@@ -258,7 +258,7 @@ namespace WalletWasabi.Gui
#region AddressManagerInitialization
- AddressManagerBehavior addressManagerBehavior = await addrManTask;
+ AddressManagerBehavior addressManagerBehavior = await addrManTask.ConfigureAwait(false);
connectionParameters.TemplateBehaviors.Add(addressManagerBehavior);
#endregion AddressManagerInitialization
@@ -297,7 +297,7 @@ namespace WalletWasabi.Gui
// This of course makes the first setting unnecessary, but it's better if that's around, in case someone wants to tinker here.
connectionParameters.EndpointConnector = new DefaultEndpointConnector(allowOnlyTorEndpoints: Network == Network.Main);
- await AddKnownBitcoinFullNodeAsHiddenServiceAsync(AddressManager);
+ await AddKnownBitcoinFullNodeAsHiddenServiceAsync(AddressManager).ConfigureAwait(false);
}
Nodes = new NodesGroup(Network, connectionParameters, requirements: Constants.NodeRequirements);
Nodes.MaximumNodeConnection = 12;
@@ -387,7 +387,7 @@ namespace WalletWasabi.Gui
{
try
{
- AddressManager = await NBitcoinHelpers.LoadAddressManagerFromPeerFileAsync(AddressManagerFilePath);
+ AddressManager = await NBitcoinHelpers.LoadAddressManagerFromPeerFileAsync(AddressManagerFilePath).ConfigureAwait(false);
// Most of the times we do not need to discover new peers. Instead, we can connect to
// some of those that we already discovered in the past. In this case we assume that
@@ -450,14 +450,14 @@ namespace WalletWasabi.Gui
// Then filtered to include only /Satoshi:0.17.x
var fullBaseDirectory = EnvironmentHelpers.GetFullBaseDirectory();
- var onions = await File.ReadAllLinesAsync(Path.Combine(fullBaseDirectory, "OnionSeeds", $"{Network}OnionSeeds.txt"));
+ var onions = await File.ReadAllLinesAsync(Path.Combine(fullBaseDirectory, "OnionSeeds", $"{Network}OnionSeeds.txt")).ConfigureAwait(false);
onions.Shuffle();
foreach (var onion in onions.Take(60))
{
if (EndPointParser.TryParse(onion, Network.DefaultPort, out var endpoint))
{
- await addressManager.AddAsync(endpoint);
+ await addressManager.AddAsync(endpoint).ConfigureAwait(false);
}
}
}
@@ -610,7 +610,7 @@ namespace WalletWasabi.Gui
{
message = Guard.Correct(message);
title = Guard.Correct(title);
- NotificationHelpers.Notify(message, title, notificationType, async () => await FileHelpers.OpenFileInTextEditorAsync(Logger.FilePath), sender);
+ NotificationHelpers.Notify(message, title, notificationType, async () => await FileHelpers.OpenFileInTextEditorAsync(Logger.FilePath).ConfigureAwait(false), sender);
Logger.LogInfo($"Transaction Notification ({notificationType}): {title} - {message} - {e.Transaction.GetHash()}");
}
@@ -628,7 +628,7 @@ namespace WalletWasabi.Gui
{
while (Interlocked.Read(ref _dispose) != 2)
{
- await Task.Delay(50);
+ await Task.Delay(50).ConfigureAwait(false);
}
return;
}
@@ -680,7 +680,7 @@ namespace WalletWasabi.Gui
if (rpcServer is { })
{
using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(21));
- await rpcServer.StopAsync(cts.Token);
+ await rpcServer.StopAsync(cts.Token).ConfigureAwait(false);
Logger.LogInfo($"{nameof(RpcServer)} is stopped.", nameof(Global));
}
@@ -701,7 +701,7 @@ namespace WalletWasabi.Gui
var synchronizer = Synchronizer;
if (synchronizer is { })
{
- await synchronizer.StopAsync();
+ await synchronizer.StopAsync().ConfigureAwait(false);
Logger.LogInfo($"{nameof(Synchronizer)} is stopped.");
}
@@ -732,7 +732,7 @@ namespace WalletWasabi.Gui
nodes.Disconnect();
while (nodes.ConnectedNodes.Any(x => x.IsConnected))
{
- await Task.Delay(50);
+ await Task.Delay(50).ConfigureAwait(false);
}
nodes.Dispose();
Logger.LogInfo($"{nameof(Nodes)} are disposed.");
@@ -759,7 +759,7 @@ namespace WalletWasabi.Gui
var torManager = TorManager;
if (torManager is { })
{
- await torManager.StopAsync();
+ await torManager.StopAsync().ConfigureAwait(false);
Logger.LogInfo($"{nameof(TorManager)} is stopped.");
}
@@ -773,7 +773,7 @@ namespace WalletWasabi.Gui
{
try
{
- await AsyncMutex.WaitForAllMutexToCloseAsync();
+ await AsyncMutex.WaitForAllMutexToCloseAsync().ConfigureAwait(false);
Logger.LogInfo($"{nameof(AsyncMutex)}(es) are stopped.");
}
catch (Exception ex)

Add missing .ConfigureAwait(false) to Global.cs