mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 20:09:23 +00:00
firo balance bug fix
This commit is contained in:
parent
70e257f5bf
commit
b4a344ebad
1 changed files with 8 additions and 51 deletions
|
@ -2490,60 +2490,17 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// final int utxosIntValue = utxos.satoshiBalance;
|
_balancePrivate = Balance(
|
||||||
// final Decimal utxosValue =
|
coin: coin,
|
||||||
// Format.satoshisToAmount(utxosIntValue, coin: coin);
|
total: intLelantusBalance + unconfirmedLelantusBalance,
|
||||||
|
spendable: intLelantusBalance,
|
||||||
// List<Decimal> balances = List.empty(growable: true);
|
blockedTotal: 0,
|
||||||
//
|
pendingSpendable: unconfirmedLelantusBalance,
|
||||||
// Decimal lelantusBalance =
|
);
|
||||||
// Format.satoshisToAmount(intLelantusBalance, coin: coin);
|
await updateCachedBalanceSecondary(_balancePrivate!);
|
||||||
|
|
||||||
// balances.add(lelantusBalance); 0
|
|
||||||
//
|
|
||||||
// balances.add(lelantusBalance * price); 1
|
|
||||||
|
|
||||||
// Decimal _unconfirmedLelantusBalance =
|
|
||||||
// Format.satoshisToAmount(unconfirmedLelantusBalance, coin: coin);
|
|
||||||
|
|
||||||
// balances.add(lelantusBalance + utxosValue + _unconfirmedLelantusBalance); 2
|
|
||||||
//
|
|
||||||
// balances.add(
|
|
||||||
// (lelantusBalance + utxosValue + _unconfirmedLelantusBalance) * price); 3
|
|
||||||
|
|
||||||
// int availableSats =
|
|
||||||
// utxos.satoshiBalance - utxos.satoshiBalanceUnconfirmed;
|
|
||||||
// if (availableSats < 0) {
|
|
||||||
// availableSats = 0;
|
|
||||||
// }
|
|
||||||
// balances.add(Format.satoshisToAmount(availableSats, coin: coin)); 4
|
|
||||||
|
|
||||||
// wait for updated uxtos to get updated public balance
|
// wait for updated uxtos to get updated public balance
|
||||||
await utxosUpdateFuture;
|
await utxosUpdateFuture;
|
||||||
|
|
||||||
// todo: shared total between private and public balances?
|
|
||||||
_balancePrivate = Balance(
|
|
||||||
coin: coin,
|
|
||||||
total: intLelantusBalance + unconfirmedLelantusBalance + balance.total,
|
|
||||||
spendable: intLelantusBalance,
|
|
||||||
blockedTotal: 0,
|
|
||||||
pendingSpendable: unconfirmedLelantusBalance + balance.total,
|
|
||||||
);
|
|
||||||
await updateCachedBalanceSecondary(_balancePrivate!);
|
|
||||||
// _balance = Balance(
|
|
||||||
// coin: coin,
|
|
||||||
// total: utxos.satoshiBalance,
|
|
||||||
// spendable: availableSats,
|
|
||||||
// blockedTotal: 0,
|
|
||||||
// pendingSpendable: utxos.satoshiBalanceUnconfirmed,
|
|
||||||
// );
|
|
||||||
|
|
||||||
// Logging.instance.log("balances $balances", level: LogLevel.Info);
|
|
||||||
// await DB.instance.put<dynamic>(
|
|
||||||
// boxName: walletId,
|
|
||||||
// key: 'totalBalance',
|
|
||||||
// value: balances[2].toString());
|
|
||||||
// return balances;
|
|
||||||
} catch (e, s) {
|
} catch (e, s) {
|
||||||
Logging.instance.log("Exception rethrown in getFullBalance(): $e\n$s",
|
Logging.instance.log("Exception rethrown in getFullBalance(): $e\n$s",
|
||||||
level: LogLevel.Error);
|
level: LogLevel.Error);
|
||||||
|
|
Loading…
Reference in a new issue