Fix maxamountsend bug
MODIFY
WalletWasabi/Models/SmartCoin.cs
WalletWasabi/Models/SmartCoin.cs
@@ -45,12 +45,11 @@ namespace WalletWasabi.Models
var rememberConfirmed = Confirmed;
_height = value;
-
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Height)));
+ OnPropertyChanged(nameof(Height));
if (rememberConfirmed != Confirmed)
{
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Confirmed)));
+ OnPropertyChanged(nameof(Confirmed));
}
}
}
@@ -65,8 +64,7 @@ namespace WalletWasabi.Models
if (value != _label)
{
_label = value;
-
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Label)));
+ OnPropertyChanged(nameof(Label));
}
}
}
@@ -81,19 +79,19 @@ namespace WalletWasabi.Models
if (value != _spenderTransactionId)
{
var rememberSpentOrCoinJoinInProcess = SpentOrCoinJoinInProcess;
+ var rememberUnspent = Unspent;
- if (_spenderTransactionId != value)
- {
_spenderTransactionId = value;
- RaisePropertyChanged();
- }
+ OnPropertyChanged(nameof(SpenderTransactionId));
- RaisePropertyChanged(nameof(Label));
- RaisePropertyChanged(nameof(Unspent));
+ if (rememberUnspent != Unspent)
+ {
+ OnPropertyChanged(nameof(Unspent));
+ }
if (rememberSpentOrCoinJoinInProcess != SpentOrCoinJoinInProcess)
{
- RaisePropertyChanged(nameof(SpentOrCoinJoinInProcess));
+ OnPropertyChanged(nameof(SpentOrCoinJoinInProcess));
}
}
}
@@ -115,10 +113,15 @@ namespace WalletWasabi.Models
{
if (_coinJoinInProcess != value)
{
+ var rememberSpentOrCoinJoinInProcess = SpentOrCoinJoinInProcess;
+
_coinJoinInProcess = value;
+ OnPropertyChanged(nameof(CoinJoinInProcess));
- RaisePropertyChanged();
- RaisePropertyChanged(nameof(SpentOrCoinJoinInProcess));
+ if (rememberSpentOrCoinJoinInProcess != SpentOrCoinJoinInProcess)
+ {
+ OnPropertyChanged(nameof(SpentOrCoinJoinInProcess));
+ }
}
}
}
@@ -179,6 +182,11 @@ namespace WalletWasabi.Models
public event PropertyChangedEventHandler PropertyChanged;
+ private void OnPropertyChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+
public Coin GetCoin()
{
return new Coin(TransactionId, Index, Amount, ScriptPubKey);
@@ -194,11 +202,6 @@ namespace WalletWasabi.Models
return new TxoRef(TransactionId, Index);
}
- private void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = "")
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-
#region EqualityAndComparison
public override bool Equals(object obj) => obj is SmartCoin && this == (SmartCoin)obj;

MODIFY
WalletWasabi/Services/WalletService.cs
WalletWasabi/Services/WalletService.cs
@@ -571,7 +571,7 @@ namespace WalletWasabi.Services
{
throw new ArgumentException($"{nameof(toSend)} cannot contain negative element.");
}
- if (toSend.Any(x => x.Amount < new Money(0.00001m, MoneyUnit.BTC)))
+ if (toSend.Any(x => x.Amount != Money.Zero && x.Amount < new Money(0.00001m, MoneyUnit.BTC)))
{
throw new InvalidOperationException($"Sanity check failed. One of the output is < 0.00001 BTC.");
}

Fix maxamountsend bug