mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +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,
|
||||
}) async {
|
||||
try {
|
||||
int satAmount = amount.raw.toInt();
|
||||
int realfee = 0;
|
||||
|
||||
if (balance.spendable == amount) {
|
||||
satAmount = balance.spendable.raw.toInt() - realfee;
|
||||
if (amount.decimals != coin.decimals) {
|
||||
throw ArgumentError("Banano prepareSend attempted with invalid Amount");
|
||||
}
|
||||
|
||||
Map<String, dynamic> txData = {
|
||||
"fee": realfee,
|
||||
"fee": 0,
|
||||
"addresss": address,
|
||||
"recipientAmt": Amount(
|
||||
rawValue: BigInt.from(satAmount),
|
||||
fractionDigits: coin.decimals,
|
||||
),
|
||||
"recipientAmt": amount,
|
||||
};
|
||||
|
||||
Logging.instance.log("prepare send: $txData", level: LogLevel.Info);
|
||||
|
|
Loading…
Reference in a new issue