mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 09:47:37 +00:00
Better error message when trying to send all and the fee is greater than the balance in the wallet
This commit is contained in:
parent
76a0a82b24
commit
ff86cbccf6
1 changed files with 7 additions and 0 deletions
|
@ -237,6 +237,13 @@ mixin ElectrumXInterface<T extends Bip39HDCurrency> on Bip39HDWallet<T> {
|
|||
}
|
||||
|
||||
final int amount = satoshiAmountToSend - feeForOneOutput;
|
||||
|
||||
if (amount < 0) {
|
||||
throw Exception(
|
||||
"Estimated fee ($feeForOneOutput sats) is greater than balance!",
|
||||
);
|
||||
}
|
||||
|
||||
final data = await buildTransaction(
|
||||
txData: txData.copyWith(
|
||||
recipients: await _helperRecipientsConvert(
|
||||
|
|
Loading…
Reference in a new issue