add insufficient balance handling
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/PrivacyControlViewModel.cs
@@ -73,11 +73,19 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
try
{
if (transactionInfo.PayJoinClient is { })
+ {
+ try
{
var transactionResult = await Task.Run(() => TransactionHelpers.BuildTransaction(_wallet, transactionInfo.Address, transactionInfo.Amount, transactionInfo.Labels, transactionInfo.FeeRate, coins, subtractFee: false, transactionInfo.PayJoinClient));
Navigate().To(new TransactionPreviewViewModel(wallet, transactionInfo, broadcaster, transactionResult));
return;
}
+ catch (InsufficientBalanceException)
+ {
+ await ShowErrorAsync("Transaction Building", "There are not enough funds selected to cover the transaction fee.", "Wasabi was unable to create your transaction.");
+ return;
+ }
+ }
try
{

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
@@ -169,11 +169,20 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
try
{
if (IsPayJoin)
+ {
+ try
{
var txRes = await Task.Run(() => TransactionHelpers.BuildTransaction(wallet, transactionInfo.Address, transactionInfo.Amount, transactionInfo.Labels, transactionInfo.FeeRate, mixedCoins, subtractFee: false, transactionInfo.PayJoinClient));
Navigate().To(new TransactionPreviewViewModel(wallet, transactionInfo, broadcaster, txRes));
return;
}
+ catch (InsufficientBalanceException)
+ {
+ await ShowErrorAsync("Transaction Building", "There are not enough private funds to cover the transaction fee", "Wasabi was unable to create your transaction.");
+ Navigate().To(new PrivacyControlViewModel(wallet, transactionInfo, broadcaster));
+ return;
+ }
+ }
try
{

add insufficient balance handling