fix: prevent RBF for Silent Payment addresses in Bitcoin transactions (#2760)

Konstantin Ullrich committed Dec 23, 2025 at 02:29 UTC 6e9d76e457cac6be12ef4a122242cdc8876c81fd
1 file changed +11
lib/view_model/transaction_details_view_model.dart
+11
@@ -1,3 +1,4 @@
1 +import 'package:cake_wallet/core/address_validator.dart';
2 import 'package:cake_wallet/tron/tron.dart';
3 import 'package:cake_wallet/wownero/wownero.dart';
4 import 'package:cw_core/currency_for_wallet_type.dart';
@@ -947,6 +948,16 @@ abstract class TransactionDetailsViewModelBase with Store {
948 Future<void> _checkForRBF(TransactionInfo tx) async {
949 if (wallet.type == WalletType.bitcoin &&
950 transactionInfo.direction == TransactionDirection.outgoing) {
951 + final descriptionKey = '${transactionInfo.txHash}_${wallet.walletAddresses.primaryAddress}';
952 + final description = transactionDescriptionBox.values
953 + .firstWhereOrNull((val) => val.id == descriptionKey || val.id == transactionInfo.txHash);
954 +
955 + if (RegExp(AddressValidator.silentPaymentAddressPatternMainnet)
956 + .hasMatch(description?.recipientAddress ?? "")) {
957 + canReplaceByFee = false;
958 + return;
959 + }
960 +
961 rawTransaction = await bitcoin!.canReplaceByFee(wallet, tx);
962 if (rawTransaction != null) {
963 canReplaceByFee = true;