Label coins under 0.0001BTC to "Dust"
MODIFY
WalletWasabi/Helpers/Constants.cs
WalletWasabi/Helpers/Constants.cs
@@ -61,5 +61,7 @@ namespace WalletWasabi.Helpers
public const string ChangeOfSpecialLabelStart = "change of (";
public const string ChangeOfSpecialLabelEnd = ")";
+
+ public static Money Dust = Money.Coins(0.0001m);
}
}

MODIFY
WalletWasabi/KeyManagement/HdPubKey.cs
WalletWasabi/KeyManagement/HdPubKey.cs
@@ -23,8 +23,10 @@ namespace WalletWasabi.KeyManagement
[JsonProperty(Order = 3)]
public string Label
{
- get => _label; private set
+ get => _label;
+ private set
{
+ value = Guard.Correct(value);
if (value != _label)
{
_label = value;
@@ -40,7 +42,7 @@ namespace WalletWasabi.KeyManagement
{
PubKey = Guard.NotNull(nameof(pubKey), pubKey);
FullKeyPath = Guard.NotNull(nameof(fullKeyPath), fullKeyPath);
- Label = Guard.Correct(label);
+ SetLabel(label, null);
KeyState = keyState;
P2pkScript = PubKey.ScriptPubKey;

MODIFY
WalletWasabi/Models/SmartCoin.cs
WalletWasabi/Models/SmartCoin.cs
@@ -131,16 +131,22 @@ namespace WalletWasabi.Models
}
}
+ /// <summary>
+ /// Always set it before the Amount!
+ /// </summary>
[JsonProperty]
public string Label
{
get => _label;
set
{
+ value = Guard.Correct(value);
+ value = Amount <= Constants.Dust ? "Dust" : value;
if (value != _label)
{
_label = value;
OnPropertyChanged(nameof(Label));
+ HasLabel = !string.IsNullOrEmpty(value);
}
}
}
@@ -452,7 +458,7 @@ namespace WalletWasabi.Models
return new TxoRef(TransactionId, Index);
}
- public bool HasLabel() => !string.IsNullOrWhiteSpace(Label);
+ public bool HasLabel { get; private set; }
public void SetClusters(string clusters)
{

Label coins under 0.0001BTC to "Dust"