Implement ObservableConcurrentHashSet, Remove NotifyingConcurrentHashSet.
This is a safe change towards the direction of resolving issue 744
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinJoinTabViewModel.cs
@@ -38,7 +38,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
Password = "";
- var onCoinsSetModified = Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.HashSetChanged))
+ var onCoinsSetModified = Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.CollectionChanged))
.ObserveOn(RxApp.MainThreadScheduler);
var globalCoins = Global.WalletService.Coins.CreateDerivedCollection(c => new CoinViewModel(c), null, (first, second) => second.Amount.CompareTo(first.Amount), signalReset: onCoinsSetModified, RxApp.MainThreadScheduler);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -33,7 +33,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Transactions = new ObservableCollection<TransactionViewModel>();
RewriteTable();
- var coinsChanged = Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.HashSetChanged));
+ var coinsChanged = Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.CollectionChanged));
var newBlockProcessed = Observable.FromEventPattern(Global.WalletService, nameof(Global.WalletService.NewBlockProcessed));
var coinSpent = Observable.FromEventPattern(Global.WalletService, nameof(Global.WalletService.CoinSpentOrSpenderConfirmed));

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/ReceiveTabViewModel.cs
@@ -28,7 +28,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
_addresses = new ObservableCollection<AddressViewModel>();
- Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.HashSetChanged))
+ Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.CollectionChanged))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(o =>
{

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/SendTabViewModel.cs
@@ -37,7 +37,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public SendTabViewModel(WalletViewModel walletViewModel)
: base("Send", walletViewModel)
{
- var onCoinsSetModified = Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.HashSetChanged))
+ var onCoinsSetModified = Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.CollectionChanged))
.ObserveOn(RxApp.MainThreadScheduler);
var globalCoins = Global.WalletService.Coins.CreateDerivedCollection(c => new CoinViewModel(c), null, (first, second) => second.Amount.CompareTo(first.Amount), signalReset: onCoinsSetModified, RxApp.MainThreadScheduler);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -27,7 +27,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public WalletViewModel(string name, bool receiveDominant)
: base(name)
{
- var coinsChanged = Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.HashSetChanged));
+ var coinsChanged = Observable.FromEventPattern(Global.WalletService.Coins, nameof(Global.WalletService.Coins.CollectionChanged));
var coinSpent = Observable.FromEventPattern(Global.WalletService, nameof(Global.WalletService.CoinSpentOrSpenderConfirmed));
coinsChanged

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -52,7 +52,7 @@ namespace WalletWasabi.Services
public ConcurrentDictionary<uint256, (Height height, DateTimeOffset dateTime)> ProcessedBlocks { get; }
private AsyncLock WalletBlocksLock { get; }
- public NotifyingConcurrentHashSet<SmartCoin> Coins { get; }
+ public ObservableConcurrentHashSet<SmartCoin> Coins { get; }
public ConcurrentHashSet<SmartTransaction> TransactionCache { get; }
@@ -87,7 +87,7 @@ namespace WalletWasabi.Services
WalletBlocksLock = new AsyncLock();
HandleFiltersLock = new AsyncLock();
- Coins = new NotifyingConcurrentHashSet<SmartCoin>();
+ Coins = new ObservableConcurrentHashSet<SmartCoin>();
TransactionCache = new ConcurrentHashSet<SmartTransaction>();
BlocksFolderPath = Path.Combine(workFolderDir, "Blocks", Network.ToString());

Implement ObservableConcurrentHashSet, Remove NotifyingConcurrentHashSet.

This is a safe change towards the direction of resolving issue 744