Display left filters in a friendly way
Left filters number is displayed as '--' when it is unknown and
with the real number when it is synchronizing.
MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -4,6 +4,8 @@ using System.Text;
using NBitcoin.Protocol;
using ReactiveUI;
using WalletWasabi.Services;
+using Avalonia.Data.Converters;
+using System.Globalization;
namespace WalletWasabi.Gui.ViewModels
{
@@ -78,6 +80,7 @@ namespace WalletWasabi.Gui.ViewModels
IndexDownloader = indexDownloader;
IndexDownloader.NewFilter += IndexDownloader_NewFilter;
+
FiltersLeft = IndexDownloader.GetFiltersLeft();
this.WhenAnyValue(x => x.BlocksLeft).Subscribe(blocks =>
@@ -157,4 +160,17 @@ namespace WalletWasabi.Gui.ViewModels
#endregion IDisposable Support
}
+
+ public class FilterLeftValueConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ return (int)value == -1 ? "--" : value.ToString();
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotSupportedException();
+ }
+ }
}

MODIFY
WalletWasabi/Services/IndexDownloader.cs
WalletWasabi/Services/IndexDownloader.cs
@@ -147,7 +147,7 @@ namespace WalletWasabi.Services
if (filtersResponse == null) // no-content, we are synced
{
- BestHeight = bestKnownStartingFilter.BlockHeight;
+ BestHeight = BestKnownFilter.BlockHeight;
continue;
}
BestHeight = filtersResponse.BestHeight;

Display left filters in a friendly way

Left filters number is displayed as '--' when it is unknown and
with the real number when it is synchronizing.