Add try/c and simplify
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -394,23 +394,35 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
Observable.FromEventPattern<SmartCoin>(Global.WalletService.TransactionProcessor, nameof(Global.WalletService.TransactionProcessor.CoinReceived))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(coin =>
+ {
+ try
{
var newCoinVm = new CoinViewModel(this, coin.EventArgs);
newCoinVm.SubscribeEvents();
RootList.Add(newCoinVm);
+ }
+ catch (Exception ex)
+ {
+ Logger.LogError(ex);
+ }
})
.DisposeWith(Disposables);
Observable.FromEventPattern<SmartCoin>(Global.WalletService.TransactionProcessor, nameof(Global.WalletService.TransactionProcessor.CoinSpent))
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(coin =>
+ {
+ try
{
CoinViewModel toRemove = RootList.Items.FirstOrDefault(cvm => cvm.Model == coin.EventArgs);
if (toRemove != default)
{
- toRemove.IsSelected = false;
- RootList.Remove(toRemove);
- toRemove.UnsubscribeEvents();
+ OnCoinUnspentChanged(toRemove);
+ }
+ }
+ catch (Exception ex)
+ {
+ Logger.LogError(ex);
}
})
.DisposeWith(Disposables);

Add try/c and simplify