Fix bestHeight change bug
MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -80,6 +80,7 @@ namespace WalletWasabi.Gui.ViewModels
IndexDownloader = indexDownloader;
IndexDownloader.NewFilter += IndexDownloader_NewFilter;
+ IndexDownloader.BestHeightChanged += IndexDownloader_BestHeightChanged;
FiltersLeft = IndexDownloader.GetFiltersLeft();
@@ -110,6 +111,11 @@ namespace WalletWasabi.Gui.ViewModels
FiltersLeft = IndexDownloader.GetFiltersLeft();
}
+ private void IndexDownloader_BestHeightChanged(object sender, Models.Height e)
+ {
+ FiltersLeft = IndexDownloader.GetFiltersLeft();
+ }
+
private void MemPoolService_TransactionReceived(object sender, Models.SmartTransaction e)
{
Mempool = MemPoolService.TransactionHashes.Count;
@@ -139,6 +145,7 @@ namespace WalletWasabi.Gui.ViewModels
Nodes.Removed -= Nodes_Removed;
MemPoolService.TransactionReceived -= MemPoolService_TransactionReceived;
IndexDownloader.NewFilter -= IndexDownloader_NewFilter;
+ IndexDownloader.BestHeightChanged -= IndexDownloader_BestHeightChanged;
}
_disposedValue = true;

MODIFY
WalletWasabi/Services/IndexDownloader.cs
WalletWasabi/Services/IndexDownloader.cs
@@ -23,7 +23,24 @@ namespace WalletWasabi.Services
public Network Network { get; }
public FilterModel BestKnownFilter { get; private set; }
- public Height BestHeight { get; private set; }
+
+ private Height _bestHeight;
+
+ public Height BestHeight
+ {
+ get => _bestHeight;
+
+ private set
+ {
+ if (_bestHeight != value)
+ {
+ _bestHeight = value;
+ BestHeightChanged?.Invoke(this, value);
+ }
+ }
+ }
+
+ public event EventHandler<Height> BestHeightChanged;
public int GetFiltersLeft()
{

Fix bestHeight change bug