Rename coin history to clusters
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
WalletWasabi.Gui/Controls/WalletExplorer/CoinListView.xaml
<controls:SortingArrow Grid.Column="4" Text="Privacy" Command="{Binding SortCommand}" SortDirection="{Binding PrivacySortDirection}" />
- <controls:SortingArrow Grid.Column="5" Text="History" Command="{Binding SortCommand}" SortDirection="{Binding HistorySortDirection}" />
+ <controls:SortingArrow Grid.Column="5" Text="Clusters" Command="{Binding SortCommand}" SortDirection="{Binding ClustersSortDirection}" />
</Grid>
<StackPanel Margin="0 10 0 0" Spacing="10" DockPanel.Dock="Bottom" Orientation="Horizontal">
<CheckBox Content = "Select All" IsThreeState="True" IsChecked = "{Binding SelectAllCheckBoxState}" Command="{Binding SelectAllCheckBoxCommand}" />
ToolTip.Tip="{Binding ToolTip}">
<DrawingPresenter Drawing="{Binding Icon}" Margin="0 0 25 0" />
</Panel>
- <controls:ExtendedTextBox Classes="selectableTextBlock" Background="Transparent" Grid.Column="5" Text="{Binding History}" />
+ <controls:ExtendedTextBox Classes="selectableTextBlock" Background="Transparent" Grid.Column="5" Text="{Binding Clusters}" />
<TextBlock Text="" Grid.Column="6" />
</Grid>
</Grid>

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -34,7 +34,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private bool? _selectPrivateCheckBoxState;
private bool? _selectNonPrivateCheckBoxState;
private GridLength _coinJoinStatusWidth;
- private SortOrder _historySortDirection;
+ private SortOrder _clustersSortDirection;
public ReactiveCommand EnqueueCoin { get; }
public ReactiveCommand DequeueCoin { get; }
@@ -99,10 +99,10 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
set => this.RaiseAndSetIfChanged(ref _privacySortDirection, value);
}
- public SortOrder HistorySortDirection
+ public SortOrder ClustersSortDirection
{
- get => _historySortDirection;
- set => this.RaiseAndSetIfChanged(ref _historySortDirection, value);
+ get => _clustersSortDirection;
+ set => this.RaiseAndSetIfChanged(ref _clustersSortDirection, value);
}
private void RefreshOrdering()
@@ -121,12 +121,12 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
else
MyComparer = SortExpressionComparer<CoinViewModel>.Descending(cvm => cvm.AnonymitySet);
}
- else if (HistorySortDirection != SortOrder.None)
+ else if (ClustersSortDirection != SortOrder.None)
{
- if (HistorySortDirection == SortOrder.Increasing)
- MyComparer = SortExpressionComparer<CoinViewModel>.Ascending(cvm => cvm.History);
+ if (ClustersSortDirection == SortOrder.Increasing)
+ MyComparer = SortExpressionComparer<CoinViewModel>.Ascending(cvm => cvm.Clusters);
else
- MyComparer = SortExpressionComparer<CoinViewModel>.Descending(cvm => cvm.History);
+ MyComparer = SortExpressionComparer<CoinViewModel>.Descending(cvm => cvm.Clusters);
}
else if (StatusSortDirection != SortOrder.None)
{
@@ -214,11 +214,11 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
PrivacySortDirection = SortOrder.None;
StatusSortDirection = SortOrder.None;
- HistorySortDirection = SortOrder.None;
+ ClustersSortDirection = SortOrder.None;
}
}).DisposeWith(Disposables);
- this.WhenAnyValue(x => x.HistorySortDirection).Subscribe(x =>
+ this.WhenAnyValue(x => x.ClustersSortDirection).Subscribe(x =>
{
if (x != SortOrder.None)
{
@@ -234,7 +234,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
AmountSortDirection = SortOrder.None;
PrivacySortDirection = SortOrder.None;
- HistorySortDirection = SortOrder.None;
+ ClustersSortDirection = SortOrder.None;
}
}).DisposeWith(Disposables);
@@ -244,7 +244,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
{
AmountSortDirection = SortOrder.None;
StatusSortDirection = SortOrder.None;
- HistorySortDirection = SortOrder.None;
+ ClustersSortDirection = SortOrder.None;
}
}).DisposeWith(Disposables);

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinViewModel.cs
@@ -60,9 +60,9 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
this.RaisePropertyChanged(nameof(Unspent));
}).DisposeWith(Disposables);
- model.WhenAnyValue(x => x.History).ObserveOn(RxApp.MainThreadScheduler).Subscribe(_ =>
+ model.WhenAnyValue(x => x.Clusters).ObserveOn(RxApp.MainThreadScheduler).Subscribe(_ =>
{
- this.RaisePropertyChanged(nameof(History));
+ this.RaisePropertyChanged(nameof(Clusters));
}).DisposeWith(Disposables);
this.WhenAnyValue(x => x.Status).Subscribe(_ =>
@@ -143,7 +143,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
public string InCoinJoin => Model.CoinJoinInProgress ? "Yes" : "No";
- public string History => Model.History;
+ public string Clusters => Model.Clusters;
public string PubKey => Model.HdPubKey.PubKey.ToString();

MODIFY
WalletWasabi/Models/SmartCoin.cs
WalletWasabi/Models/SmartCoin.cs
@@ -48,7 +48,7 @@ namespace WalletWasabi.Models
private bool _spentOrCoinJoinInProgress;
private bool _unspent;
private bool _isBanned;
- private string _history;
+ private string _clusters;
#endregion Fields
@@ -289,15 +289,15 @@ namespace WalletWasabi.Models
}
}
- public string History
+ public string Clusters
{
- get => _history;
+ get => _clusters;
private set
{
- if (value != _history)
+ if (value != _clusters)
{
- _history = value;
- OnPropertyChanged(nameof(History));
+ _clusters = value;
+ OnPropertyChanged(nameof(Clusters));
}
}
}
@@ -454,9 +454,9 @@ namespace WalletWasabi.Models
public bool HasLabel() => !string.IsNullOrWhiteSpace(Label);
- public void SetHistory(string history)
+ public void SetClusters(string clusters)
{
- History = history;
+ Clusters = clusters;
}
#endregion Methods

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -359,7 +359,7 @@ namespace WalletWasabi.Services
return ret;
}
- public List<SmartCoin> GetHistory(SmartCoin coin, List<SmartCoin> current, ILookup<Script, SmartCoin> lookupScriptPubKey, ILookup<uint256, SmartCoin> lookupSpenderTransactionId, ILookup<uint256, SmartCoin> lookupTransactionId)
+ public List<SmartCoin> GetClusters(SmartCoin coin, List<SmartCoin> current, ILookup<Script, SmartCoin> lookupScriptPubKey, ILookup<uint256, SmartCoin> lookupSpenderTransactionId, ILookup<uint256, SmartCoin> lookupTransactionId)
{
Guard.NotNull(nameof(coin), coin);
if (current.Contains(coin))
@@ -367,19 +367,19 @@ namespace WalletWasabi.Services
return current;
}
- var history = current.Concat(new List<SmartCoin> { coin }).ToList(); // Fhe coin is the first elem in its history.
+ var clusters = current.Concat(new List<SmartCoin> { coin }).ToList(); // The coin is the first elem in its cluster.
// If the script is the same then we have a match, no matter of the anonimity set.
foreach (var c in lookupScriptPubKey[coin.ScriptPubKey])
{
- if (!history.Contains(c))
+ if (!clusters.Contains(c))
{
- var h = GetHistory(c, history, lookupScriptPubKey, lookupSpenderTransactionId, lookupTransactionId);
+ var h = GetClusters(c, clusters, lookupScriptPubKey, lookupSpenderTransactionId, lookupTransactionId);
foreach (var hr in h)
{
- if (!history.Contains(hr))
+ if (!clusters.Contains(hr))
{
- history.Add(hr);
+ clusters.Add(hr);
}
}
}
@@ -388,15 +388,15 @@ namespace WalletWasabi.Services
// If it spends someone and hasn't been sufficiently anonymized.
if (coin.AnonymitySet < ServiceConfiguration.PrivacyLevelStrong)
{
- var c = lookupSpenderTransactionId[coin.TransactionId].Where(x => !history.Contains(x)).FirstOrDefault();
+ var c = lookupSpenderTransactionId[coin.TransactionId].Where(x => !clusters.Contains(x)).FirstOrDefault();
if (c != default)
{
- var h = GetHistory(c, history, lookupScriptPubKey, lookupSpenderTransactionId, lookupTransactionId);
+ var h = GetClusters(c, clusters, lookupScriptPubKey, lookupSpenderTransactionId, lookupTransactionId);
foreach (var hr in h)
{
- if (!history.Contains(hr))
+ if (!clusters.Contains(hr))
{
- history.Add(hr);
+ clusters.Add(hr);
}
}
}
@@ -405,19 +405,19 @@ namespace WalletWasabi.Services
// If it's being spent by someone and that someone hasn't been sufficiently anonymized.
if (!coin.Unspent)
{
- var c = lookupTransactionId[coin.SpenderTransactionId].Where(x => !history.Contains(x)).FirstOrDefault();
+ var c = lookupTransactionId[coin.SpenderTransactionId].Where(x => !clusters.Contains(x)).FirstOrDefault();
if (c != default)
{
if (c.AnonymitySet < ServiceConfiguration.PrivacyLevelStrong)
{
if (c != default)
{
- var h = GetHistory(c, history, lookupScriptPubKey, lookupSpenderTransactionId, lookupTransactionId);
+ var h = GetClusters(c, clusters, lookupScriptPubKey, lookupSpenderTransactionId, lookupTransactionId);
foreach (var hr in h)
{
- if (!history.Contains(hr))
+ if (!clusters.Contains(hr))
{
- history.Add(hr);
+ clusters.Add(hr);
}
}
}
@@ -425,7 +425,7 @@ namespace WalletWasabi.Services
}
}
- return history;
+ return clusters;
}
private void ProcessBlock(Height height, Block block)
@@ -1284,7 +1284,7 @@ namespace WalletWasabi.Services
{
Interlocked.Increment(ref _refreshCoinCalls);
}
- var unspentCoins = Coins.Where(c => c.Unspent); //refreshing unspent coins history only
+ var unspentCoins = Coins.Where(c => c.Unspent); //refreshing unspent coins clusters only
if (unspentCoins.Any())
{
ILookup<Script, SmartCoin> lookupScriptPubKey = Coins.ToLookup(c => c.ScriptPubKey, c => c);
@@ -1295,8 +1295,8 @@ namespace WalletWasabi.Services
await Task.Run(() => Parallel.ForEach(unspentCoins, new ParallelOptions { MaxDegreeOfParallelism = simultaneousThread }, coin =>
{
- var result = string.Join(", ", GetHistory(coin, new List<SmartCoin>(), lookupScriptPubKey, lookupSpenderTransactionId, lookupTransactionId).Select(x => x.Label).Distinct());
- coin.SetHistory(result);
+ var result = string.Join(", ", GetClusters(coin, new List<SmartCoin>(), lookupScriptPubKey, lookupSpenderTransactionId, lookupTransactionId).Select(x => x.Label).Distinct());
+ coin.SetClusters(result);
}));
}
if (Interlocked.Read(ref _refreshCoinCalls) == 2) //scheduled to rerun so we start the work again
@@ -1314,7 +1314,7 @@ namespace WalletWasabi.Services
catch (Exception ex)
{
Interlocked.Exchange(ref _refreshCoinCalls, 0);
- Logger.LogError<WalletService>($"Refreshing coins history failed: {ex}");
+ Logger.LogError<WalletService>($"Refreshing coin clusters failed: {ex}");
}
}

Rename coin history to clusters