Implement fix from
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyRing/PrivacyBarItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyRing/PrivacyBarItemViewModel.cs
@@ -29,8 +29,8 @@ public class PrivacyBarItemViewModel : ViewModelBase, IDisposable
public PrivacyBarItemViewModel(Pocket pocket, Wallet wallet, double start, double width)
{
- IsPrivate = pocket.Coins.First().IsPrivate(wallet.KeyManager.AnonScoreTarget);
- IsSemiPrivate = !IsPrivate && pocket.Coins.First().IsSemiPrivate();
+ IsPrivate = pocket.Coins.All(x => x.IsPrivate(wallet.KeyManager.AnonScoreTarget));
+ IsSemiPrivate = !IsPrivate && pocket.Coins.All(x => x.IsSemiPrivate());
IsNonPrivate = !IsPrivate && !IsSemiPrivate;
Data = new RectangleGeometry

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyRing/PrivacyBarViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyRing/PrivacyBarViewModel.cs
@@ -89,7 +89,12 @@ public partial class PrivacyBarViewModel : ViewModelBase
var usableWidth = Width - (coinCount * 2);
- foreach (var pocket in pockets.OrderByDescending(x => x.Coins.First().HdPubKey.AnonymitySet))
+ var usablePockets =
+ pockets.Where(x => x.Coins.Any())
+ .OrderByDescending(x => x.Coins.First().HdPubKey.AnonymitySet)
+ .ToList();
+
+ foreach (var pocket in usablePockets)
{
var pocketCoins = pocket.Coins.OrderByDescending(x => x.Amount).ToList();
@@ -120,7 +125,12 @@ public partial class PrivacyBarViewModel : ViewModelBase
var usableWidth = Width - (pockets.Count() * 2);
- foreach (var pocket in pockets.OrderByDescending(x => x.Coins.First().HdPubKey.AnonymitySet))
+ var usablePockets =
+ pockets.Where(x => x.Coins.Any())
+ .OrderByDescending(x => x.Coins.First().HdPubKey.AnonymitySet)
+ .ToList();
+
+ foreach (var pocket in usablePockets)
{
var margin = 2;
var amount = pocket.Amount.ToDecimal(NBitcoin.MoneyUnit.BTC);

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyRing/PrivacyRingItemViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyRing/PrivacyRingItemViewModel.cs
@@ -35,8 +35,8 @@ public class PrivacyRingItemViewModel : IPrivacyRingPreviewItem, IDisposable
Data = CreateGeometry(start, end, OuterRadius);
- IsPrivate = pocket.Coins.First().IsPrivate(parent.Wallet.KeyManager.AnonScoreTarget);
- IsSemiPrivate = !IsPrivate && pocket.Coins.First().IsSemiPrivate();
+ IsPrivate = pocket.Coins.All(x => x.IsPrivate(parent.Wallet.KeyManager.AnonScoreTarget));
+ IsSemiPrivate = !IsPrivate && pocket.Coins.All(x => x.IsSemiPrivate());
IsNonPrivate = !IsPrivate && !IsSemiPrivate;
AmountText = $"{pocket.Amount.ToFormattedString()} BTC";
Unconfirmed = false;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyRing/PrivacyRingViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/PrivacyRing/PrivacyRingViewModel.cs
@@ -120,7 +120,12 @@ public partial class PrivacyRingViewModel : RoutableViewModel
var total = pockets.Sum(x => Math.Abs(x.Amount.ToDecimal(NBitcoin.MoneyUnit.BTC)));
var start = 0.0m;
- foreach (var pocket in pockets.OrderByDescending(x => x.Coins.First().HdPubKey.AnonymitySet))
+ var usablePockets =
+ pockets.Where(x => x.Coins.Any())
+ .OrderByDescending(x => x.Coins.First().HdPubKey.AnonymitySet)
+ .ToList();
+
+ foreach (var pocket in usablePockets)
{
var pocketCoins = pocket.Coins.OrderByDescending(x => x.Amount).ToList();
@@ -142,7 +147,12 @@ public partial class PrivacyRingViewModel : RoutableViewModel
var total = pockets.Sum(x => Math.Abs(x.Amount.ToDecimal(NBitcoin.MoneyUnit.BTC)));
var start = 0.0m;
- foreach (var pocket in pockets.OrderByDescending(x => x.Coins.First().HdPubKey.AnonymitySet))
+ var usablePockets =
+ pockets.Where(x => x.Coins.Any())
+ .OrderByDescending(x => x.Coins.First().HdPubKey.AnonymitySet)
+ .ToList();
+
+ foreach (var pocket in usablePockets)
{
var end = start + (Math.Abs(pocket.Amount.ToDecimal(NBitcoin.MoneyUnit.BTC)) / total);

Implement fix from #9125