From 6e9d76e457cac6be12ef4a122242cdc8876c81fd Mon Sep 17 00:00:00 2001 From: Konstantin Ullrich Date: Tue, 23 Dec 2025 02:29:30 +0100 Subject: [PATCH] fix: prevent RBF for Silent Payment addresses in Bitcoin transactions (#2760) --- lib/view_model/transaction_details_view_model.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/view_model/transaction_details_view_model.dart b/lib/view_model/transaction_details_view_model.dart index 810d08c16..20736952e 100644 --- a/lib/view_model/transaction_details_view_model.dart +++ b/lib/view_model/transaction_details_view_model.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/core/address_validator.dart'; import 'package:cake_wallet/tron/tron.dart'; import 'package:cake_wallet/wownero/wownero.dart'; import 'package:cw_core/currency_for_wallet_type.dart'; @@ -947,6 +948,16 @@ abstract class TransactionDetailsViewModelBase with Store { Future _checkForRBF(TransactionInfo tx) async { if (wallet.type == WalletType.bitcoin && transactionInfo.direction == TransactionDirection.outgoing) { + final descriptionKey = '${transactionInfo.txHash}_${wallet.walletAddresses.primaryAddress}'; + final description = transactionDescriptionBox.values + .firstWhereOrNull((val) => val.id == descriptionKey || val.id == transactionInfo.txHash); + + if (RegExp(AddressValidator.silentPaymentAddressPatternMainnet) + .hasMatch(description?.recipientAddress ?? "")) { + canReplaceByFee = false; + return; + } + rawTransaction = await bitcoin!.canReplaceByFee(wallet, tx); if (rawTransaction != null) { canReplaceByFee = true;