Make confirmations more responsive.
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
@@ -32,6 +32,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
this.RaisePropertyChanged(nameof(CoinJoinInProgress));
});
+
+ Global.IndexDownloader.WhenAnyValue(x => x.BestHeight).ObserveOn(RxApp.MainThreadScheduler).Subscribe(_ =>
+ {
+ this.RaisePropertyChanged(nameof(Confirmations));
+ });
}
public SmartCoin Model { get; }

MODIFY
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
WalletWasabi.Gui/ViewModels/StatusBarViewModel.cs
@@ -171,13 +171,17 @@ namespace WalletWasabi.Gui.ViewModels
IndexDownloader = indexDownloader;
UpdateChecker = updateChecker;
IndexDownloader.NewFilter += IndexDownloader_NewFilter;
- IndexDownloader.BestHeightChanged += IndexDownloader_BestHeightChanged;
IndexDownloader.TorStatusChanged += IndexDownloader_TorStatusChanged;
IndexDownloader.BackendStatusChanged += IndexDownloader_BackendStatusChanged;
IndexDownloader.ResponseArrivedIsGenSocksServFail += IndexDownloader_ResponseArrivedIsGenSocksServFail;
FiltersLeft = IndexDownloader.GetFiltersLeft();
+ IndexDownloader.WhenAnyValue(x => x.BestHeight).ObserveOn(RxApp.MainThreadScheduler).Subscribe(_ =>
+ {
+ FiltersLeft = IndexDownloader.GetFiltersLeft();
+ });
+
this.WhenAnyValue(x => x.BlocksLeft).Subscribe(blocks =>
{
SetStatusAndDoUpdateActions();
@@ -313,11 +317,6 @@ namespace WalletWasabi.Gui.ViewModels
FiltersLeft = IndexDownloader.GetFiltersLeft();
}
- private void IndexDownloader_BestHeightChanged(object sender, Height e)
- {
- FiltersLeft = IndexDownloader.GetFiltersLeft();
- }
-
private void MemPoolService_TransactionReceived(object sender, SmartTransaction e)
{
Mempool = MemPoolService.TransactionHashes.Count;
@@ -347,7 +346,6 @@ namespace WalletWasabi.Gui.ViewModels
Nodes.Removed -= Nodes_Removed;
MemPoolService.TransactionReceived -= MemPoolService_TransactionReceived;
IndexDownloader.NewFilter -= IndexDownloader_NewFilter;
- IndexDownloader.BestHeightChanged -= IndexDownloader_BestHeightChanged;
IndexDownloader.TorStatusChanged -= IndexDownloader_TorStatusChanged;
IndexDownloader.BackendStatusChanged -= IndexDownloader_BackendStatusChanged;
IndexDownloader.ResponseArrivedIsGenSocksServFail -= IndexDownloader_ResponseArrivedIsGenSocksServFail;

MODIFY
WalletWasabi/Services/IndexDownloader.cs
WalletWasabi/Services/IndexDownloader.cs
@@ -15,10 +15,11 @@ using System.Threading.Tasks;
using WalletWasabi.Backend.Models.Responses;
using WalletWasabi.Exceptions;
using WalletWasabi.WebClients.Wasabi;
+using System.ComponentModel;
namespace WalletWasabi.Services
{
- public class IndexDownloader : IDisposable
+ public class IndexDownloader : IDisposable, INotifyPropertyChanged
{
public Network Network { get; }
@@ -35,15 +36,13 @@ namespace WalletWasabi.Services
if (_bestHeight != value)
{
_bestHeight = value;
- BestHeightChanged?.Invoke(this, value);
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(BestHeight)));
}
}
}
public event EventHandler<bool> ResponseArrivedIsGenSocksServFail;
- public event EventHandler<Height> BestHeightChanged;
-
private TorStatus _torStatus;
public TorStatus TorStatus
@@ -103,6 +102,8 @@ namespace WalletWasabi.Services
public event EventHandler<FilterModel> NewFilter;
+ public event PropertyChangedEventHandler PropertyChanged;
+
public static FilterModel GetStartingFilter(Network network)
{
if (network == Network.Main)

Make confirmations more responsive.