Show if we are processing the transactions or the filters.
MODIFY
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
WalletWasabi.Gui/Tabs/WalletManager/LoadWalletViewModel.cs
@@ -609,7 +609,6 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
try
{
IsBusy = true;
- MainWindowViewModel.Instance.StatusBar.TryAddStatus(StatusType.WalletLoading);
var keyManager = await LoadKeyManagerAsync(IsPasswordRequired, IsHardwareWallet);
if (keyManager is null)
@@ -646,7 +645,6 @@ namespace WalletWasabi.Gui.Tabs.WalletManager
}
finally
{
- MainWindowViewModel.Instance.StatusBar.TryRemoveStatus(StatusType.WalletLoading, StatusType.WalletProcessingTransactions, StatusType.WalletProcessingFilters);
IsBusy = false;
}
}

MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -101,6 +101,51 @@ namespace WalletWasabi.Gui.ViewModels
.Subscribe(x => DownloadingBlock = x.EventArgs)
.DisposeWith(Disposables);
+ Observable.FromEventPattern<bool>(typeof(WalletService), nameof(WalletService.InitializingChanged))
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(x =>
+ {
+ if (x.EventArgs)
+ {
+ TryAddStatus(StatusType.WalletLoading);
+ }
+ else
+ {
+ TryRemoveStatus(StatusType.WalletLoading);
+ }
+ })
+ .DisposeWith(Disposables);
+
+ Observable.FromEventPattern<bool>(typeof(WalletService), nameof(WalletService.InitializingTransactionsChanged))
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(x =>
+ {
+ if (x.EventArgs)
+ {
+ TryAddStatus(StatusType.WalletProcessingTransactions);
+ }
+ else
+ {
+ TryRemoveStatus(StatusType.WalletProcessingTransactions);
+ }
+ })
+ .DisposeWith(Disposables);
+
+ Observable.FromEventPattern<bool>(typeof(WalletService), nameof(WalletService.InitializingFiltersChanged))
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(x =>
+ {
+ if (x.EventArgs)
+ {
+ TryAddStatus(StatusType.WalletProcessingFilters);
+ }
+ else
+ {
+ TryRemoveStatus(StatusType.WalletProcessingFilters);
+ }
+ })
+ .DisposeWith(Disposables);
+
Synchronizer.WhenAnyValue(x => x.TorStatus)
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(status => Tor = UseTor ? status : TorStatus.TurnedOff)

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -36,6 +36,12 @@ namespace WalletWasabi.Services
{
public static event EventHandler<bool> DownloadingBlockChanged;
+ public static event EventHandler<bool> InitializingChanged;
+
+ public static event EventHandler<bool> InitializingTransactionsChanged;
+
+ public static event EventHandler<bool> InitializingFiltersChanged;
+
// So we will make sure when blocks are downloading with multiple wallet services, they do not conflict.
private static AsyncLock BlockDownloadLock { get; } = new AsyncLock();
@@ -49,7 +55,6 @@ namespace WalletWasabi.Services
if (value != DownloadingBlockBacking)
{
DownloadingBlockBacking = value;
- DownloadingBlockChanged?.Invoke(null, value);
}
}
}
@@ -250,6 +255,8 @@ namespace WalletWasabi.Services
}
public async Task InitializeAsync(CancellationToken cancel)
+ {
+ try
{
if (!Synchronizer.IsRunning)
{
@@ -271,14 +278,30 @@ namespace WalletWasabi.Services
await LoadDummyMempoolAsync();
}
}
+ finally
+ {
+ InitializingChanged?.Invoke(null, false);
+ }
+ }
private async Task LoadWalletStateAsync(CancellationToken cancel)
{
KeyManager.AssertNetworkOrClearBlockState(Network);
Height bestKeyManagerHeight = KeyManager.GetBestHeight();
+ try
+ {
+ InitializingTransactionsChanged?.Invoke(null, true);
TransactionProcessor.Process(BitcoinStore.TransactionStore.ConfirmedStore.GetTransactions().TakeWhile(x => x.Height <= bestKeyManagerHeight));
+ }
+ finally
+ {
+ InitializingTransactionsChanged?.Invoke(null, false);
+ }
+ try
+ {
+ InitializingFiltersChanged?.Invoke(null, true);
// Go through the filters and queue to download the matches.
await BitcoinStore.IndexStore.ForeachFiltersAsync(async (filterModel) =>
{
@@ -289,6 +312,11 @@ namespace WalletWasabi.Services
},
new Height(bestKeyManagerHeight.Value + 1));
}
+ finally
+ {
+ InitializingFiltersChanged?.Invoke(null, false);
+ }
+ }
private async Task LoadDummyMempoolAsync()
{

Show if we are processing the transactions or the filters.