mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-16 17:27:37 +00:00
feat: Activate CPFP for BTC, LTC and BCH, also fix issues with frozen balance display
This commit is contained in:
parent
3818b0a390
commit
f776052a5f
3 changed files with 4 additions and 19 deletions
|
@ -39,12 +39,7 @@ class ElectrumBalance extends Balance {
|
|||
int secondUnconfirmed = 0;
|
||||
|
||||
@override
|
||||
String get formattedAvailableBalance {
|
||||
bool isOutgoingTx = unconfirmed.isNegative;
|
||||
final availableBalance =
|
||||
isOutgoingTx ? ((confirmed + unconfirmed) - frozen) : (confirmed - frozen);
|
||||
return bitcoinAmountToString(amount: availableBalance);
|
||||
}
|
||||
String get formattedAvailableBalance => bitcoinAmountToString(amount: ((confirmed + unconfirmed) - frozen) );
|
||||
|
||||
@override
|
||||
String get formattedAdditionalBalance => bitcoinAmountToString(amount: unconfirmed);
|
||||
|
@ -63,7 +58,7 @@ class ElectrumBalance extends Balance {
|
|||
|
||||
@override
|
||||
String get formattedFullAvailableBalance =>
|
||||
bitcoinAmountToString(amount: confirmed + secondConfirmed - frozen);
|
||||
bitcoinAmountToString(amount: (confirmed + unconfirmed) + secondConfirmed - frozen);
|
||||
|
||||
String toJSON() => json.encode({
|
||||
'confirmed': confirmed,
|
||||
|
|
|
@ -2081,18 +2081,6 @@ abstract class ElectrumWalletBase
|
|||
var totalConfirmed = 0;
|
||||
var totalUnconfirmed = 0;
|
||||
|
||||
unspentCoinsInfo.values.forEach((info) {
|
||||
unspentCoins.forEach((element) {
|
||||
if (element.hash == info.hash &&
|
||||
element.vout == info.vout &&
|
||||
info.isFrozen &&
|
||||
element.bitcoinAddressRecord.address == info.address &&
|
||||
element.value == info.value) {
|
||||
totalFrozen += element.value;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (hasSilentPaymentsScanning) {
|
||||
// Add values from unspent coins that are not fetched by the address list
|
||||
// i.e. scanned silent payments
|
||||
|
|
|
@ -379,6 +379,8 @@ abstract class BalanceViewModelBase with Store {
|
|||
case WalletType.solana:
|
||||
case WalletType.tron:
|
||||
case WalletType.bitcoin:
|
||||
case WalletType.bitcoinCash:
|
||||
case WalletType.litecoin:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue