File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
app/src/main/java/one/mixin/android/web3/details Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,8 @@ class Web3TransactionFragment : BaseFragment(R.layout.fragment_web3_transaction)
525525 }
526526 val currentRate: BigDecimal ? = estimateFeeResponse.feeRate?.toBigDecimalOrNull()
527527 val localRate: BigDecimal ? = localRateString.toBigDecimalOrNull()
528+ // Only allow speed-up when the recommended fee rate is strictly higher than the current tx fee rate.
529+ // BigDecimal.compareTo returns 1 when currentRate > localRate.
528530 if (currentRate != null && localRate != null && currentRate.compareTo(localRate) != 1 ) {
529531 toast(getString(R .string.web3_btc_speed_up_not_needed))
530532 return @launch
@@ -566,6 +568,7 @@ class Web3TransactionFragment : BaseFragment(R.layout.fragment_web3_transaction)
566568 lifecycleScope.launch {
567569 if (token.chainId == Constants .ChainId .BITCOIN_CHAIN_ID ) {
568570 val fromAddress: String = transaction.getFromAddress()
571+ // Whether this BTC transaction can be cancelled via a replacement tx (RBF).
569572 val canCancelBtcTransaction: Boolean = canCancelBtcTransaction(rawTransaction.raw, fromAddress)
570573 if (! canCancelBtcTransaction) {
571574 toast(R .string.web3_btc_cancel_not_possible)
You can’t perform that action at this time.
0 commit comments