Check if recordList element was removed
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/HistoryTabViewModel.cs
@@ -171,11 +171,13 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
var found = txRecordList.FirstOrDefault(x => x.transactionId == coin.TransactionId);
if (found != default) // if found
{
- txRecordList.Remove(found);
+ if (txRecordList.Remove(found))
+ {
var foundLabel = found.label != string.Empty ? found.label + ", " : "";
var newRecord = (dateTime, found.height, found.amount + coin.Amount, $"{foundLabel}{coin.Label}", coin.TransactionId);
txRecordList.Add(newRecord);
}
+ }
else
{
txRecordList.Add((dateTime, coin.Height, coin.Amount, coin.Label.ToString(), coin.TransactionId));
@@ -208,10 +210,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
var foundSpenderCoin = txRecordList.FirstOrDefault(x => x.transactionId == coin.SpenderTransactionId);
if (foundSpenderCoin != default) // if found
{
- txRecordList.Remove(foundSpenderCoin);
+ if (txRecordList.Remove(foundSpenderCoin))
+ {
var newRecord = (dateTime, foundSpenderTransaction.Height, foundSpenderCoin.amount - coin.Amount, foundSpenderCoin.label, coin.SpenderTransactionId);
txRecordList.Add(newRecord);
}
+ }
else
{
txRecordList.Add((dateTime, foundSpenderTransaction.Height, (Money.Zero - coin.Amount), "", coin.SpenderTransactionId));

Check if recordList element was removed