mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
fix: banano prepareSend int overflow
This commit is contained in:
parent
a3dcdf6fcd
commit
885310395e
1 changed files with 4 additions and 10 deletions
|
@ -668,20 +668,14 @@ class BananoWallet extends CoinServiceAPI
|
||||||
Map<String, dynamic>? args,
|
Map<String, dynamic>? args,
|
||||||
}) async {
|
}) async {
|
||||||
try {
|
try {
|
||||||
int satAmount = amount.raw.toInt();
|
if (amount.decimals != coin.decimals) {
|
||||||
int realfee = 0;
|
throw ArgumentError("Banano prepareSend attempted with invalid Amount");
|
||||||
|
|
||||||
if (balance.spendable == amount) {
|
|
||||||
satAmount = balance.spendable.raw.toInt() - realfee;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> txData = {
|
Map<String, dynamic> txData = {
|
||||||
"fee": realfee,
|
"fee": 0,
|
||||||
"addresss": address,
|
"addresss": address,
|
||||||
"recipientAmt": Amount(
|
"recipientAmt": amount,
|
||||||
rawValue: BigInt.from(satAmount),
|
|
||||||
fractionDigits: coin.decimals,
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Logging.instance.log("prepare send: $txData", level: LogLevel.Info);
|
Logging.instance.log("prepare send: $txData", level: LogLevel.Info);
|
||||||
|
|
Loading…
Reference in a new issue