feat: Activate CPFP for BTC, LTC and BCH, also fix issues with frozen balance display

This commit is contained in:
Blazebrain 2024-11-08 18:10:02 +01:00
parent 3818b0a390
commit f776052a5f
3 changed files with 4 additions and 19 deletions

View file

@ -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,

View file

@ -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

View file

@ -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;