save how many filters are needed to download and sync
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/LoadingViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/LoadingViewModel.cs
@@ -23,6 +23,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
private uint? _startingFilterIndex;
private Stopwatch? _stopwatch;
private bool _isLoading;
+ private uint _filtersToSyncCount;
+ private uint _filtersToProcessCount;
public LoadingViewModel(Wallet wallet)
{
@@ -107,6 +109,19 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
.DisposeWith(disposables);
}
+ private void SetInitValues()
+ {
+ _filtersToSyncCount = (uint) Services.BitcoinStore.SmartHeaderChain.HashesLeft;
+
+ if (Services.BitcoinStore.SmartHeaderChain.ServerTipHeight is { } tipHeight)
+ {
+ var startingHeight = SmartHeader.GetStartingHeader(_wallet.Network).Height;
+ var bestHeight = (uint) _wallet.KeyManager.GetBestHeight().Value;
+
+ _filtersToProcessCount = tipHeight - (bestHeight < startingHeight ? startingHeight : bestHeight);
+ }
+ }
+
private void UpdateStatus(uint allFilters, uint processedFilters, double elapsedMilliseconds)
{
var percent = (decimal) processedFilters / allFilters * 100;

save how many filters are needed to download and sync