Skip to content

Commit

Permalink
Handle Lelantus AmountWithFeeExceedsBalance
Browse files Browse the repository at this point in the history
  • Loading branch information
KuroGuo committed Jun 16, 2021
1 parent 237d229 commit 6fd41c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,9 @@ WalletModel::SendCoinsReturn WalletModel::prepareJoinSplitTransaction(
*newTx = wallet->CreateLelantusJoinSplitTransaction(vecSend, feeRequired, {}, spendCoins, sigmaSpendCoins, mintCoins, coinControl);
} catch (InsufficientFunds const&) {
transaction.setTransactionFee(feeRequired);
if (!fSubtractFeeFromAmount && (total + feeRequired) > nBalance) {
return SendCoinsReturn(AmountWithFeeExceedsBalance);
}
return SendCoinsReturn(AmountExceedsBalance);
} catch (std::runtime_error const &e) {
Q_EMIT message(
Expand Down

0 comments on commit 6fd41c0

Please sign in to comment.