Change dust control
MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/CoinListViewModel.cs
@@ -368,7 +368,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
switch (e.Action)
{
case NotifyCollectionChangedAction.Add:
- foreach (SmartCoin c in e.NewItems.Cast<SmartCoin>().Where(sc => sc.Unspent && !sc.IsDust))
+ foreach (SmartCoin c in e.NewItems.Cast<SmartCoin>().Where(sc => sc.Unspent))
{
var newCoinVm = new CoinViewModel(this, c);
newCoinVm.SubscribeEvents();

MODIFY
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
WalletWasabi.Gui/Controls/WalletExplorer/WalletViewModel.cs
@@ -105,7 +105,7 @@ namespace WalletWasabi.Gui.Controls.WalletExplorer
private void SetBalance(string walletName)
{
- Money balance = Enumerable.Where(WalletService.Coins, c => c.Unspent && !c.IsDust && !c.SpentAccordingToBackend).Sum(c => (long?)c.Amount) ?? 0;
+ Money balance = Enumerable.Where(WalletService.Coins, c => c.Unspent && !c.SpentAccordingToBackend).Sum(c => (long?)c.Amount) ?? 0;
Title = $"{walletName} ({(Global.UiConfig.LurkingWifeMode.Value ? "#########" : balance.ToString(false, true))} BTC)";
}

MODIFY
WalletWasabi/Models/SmartCoin.cs
WalletWasabi/Models/SmartCoin.cs
@@ -43,7 +43,6 @@ namespace WalletWasabi.Models
private HdPubKey _hdPubKey;
private ISecret _secret;
- private bool _isDust;
private string _clusters;
private bool _confirmed;
@@ -298,22 +297,6 @@ namespace WalletWasabi.Models
}
}
- [JsonProperty]
- public bool IsDust
- {
- get => _isDust;
- private set
- {
- if (value != _isDust)
- {
- _isDust = value;
- OnPropertyChanged(nameof(IsDust));
-
- SetUnavailable();
- }
- }
- }
-
public string Clusters
{
get => _clusters;
@@ -409,12 +392,7 @@ namespace WalletWasabi.Models
private void SetUnavailable()
{
- Unavailable = !Unspent || SpentAccordingToBackend || CoinJoinInProgress || IsDust;
- }
-
- private void SetIsDust(Money dustThreshold)
- {
- IsDust = Amount <= dustThreshold;
+ Unavailable = !Unspent || SpentAccordingToBackend || CoinJoinInProgress;
}
#endregion PropertySetters
@@ -464,7 +442,6 @@ namespace WalletWasabi.Models
SetUnspent();
SetIsBanned();
SetUnavailable();
- SetIsDust(Constants.DustThreshold);
}
#endregion Constructors

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -612,6 +612,11 @@ namespace WalletWasabi.Services
}
}
+ if(output.Value <= Constants.DustThreshold)
+ {
+ continue;
+ }
+
SmartCoin newCoin = new SmartCoin(txId, i, output.ScriptPubKey, output.Value, tx.Transaction.Inputs.ToTxoRefs().ToArray(), tx.Height, tx.IsRBF, anonset, foundKey.Label, spenderTransactionId: null, false, pubKey: foundKey); // Don't inherit locked status from key, that's different.
// If we didn't have it.
if (Coins.TryAdd(newCoin))
@@ -619,7 +624,7 @@ namespace WalletWasabi.Services
TransactionCache.TryAdd(tx);
// If it's being mixed and anonset is not sufficient, then queue it.
- if (newCoin.Unspent && !newCoin.IsDust && ChaumianClient.HasIngredients && newCoin.Label.StartsWith("ZeroLink", StringComparison.Ordinal) && newCoin.AnonymitySet < ServiceConfiguration.MixUntilAnonymitySet)
+ if (newCoin.Unspent && ChaumianClient.HasIngredients && newCoin.Label.StartsWith("ZeroLink", StringComparison.Ordinal) && newCoin.AnonymitySet < ServiceConfiguration.MixUntilAnonymitySet)
{
Task.Run(async () =>
{
@@ -1519,7 +1524,7 @@ namespace WalletWasabi.Services
try
{
- var unspentCoins = Coins.Where(c => c.Unspent && !c.IsDust); //refreshing unspent coins clusters 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);

Change dust control