Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/qt/forms/sendcoinsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1049,16 +1049,6 @@ Note: Since the fee is calculated on a per-byte basis, a fee rate of "100 satos
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="optInRBF">
<property name="text">
<string>Enable Replace-By-Fee</string>
</property>
<property name="toolTip">
<string>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
Expand Down
24 changes: 4 additions & 20 deletions src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,6 @@ void SendCoinsDialog::setModel(WalletModel *_model)
connect(ui->groupFee, &QButtonGroup::idClicked, this, &SendCoinsDialog::coinControlUpdateLabels);

connect(ui->customFee, &BitcoinAmountField::valueChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0))
connect(ui->optInRBF, &QCheckBox::checkStateChanged, this, &SendCoinsDialog::updateSmartFeeLabel);
connect(ui->optInRBF, &QCheckBox::checkStateChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
#else
connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::updateSmartFeeLabel);
connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
#endif
CAmount requiredFee = model->wallet().getRequiredFee(1000);
ui->customFee->SetMinValue(requiredFee);
if (ui->customFee->value() < requiredFee) {
Expand All @@ -195,9 +188,6 @@ void SendCoinsDialog::setModel(WalletModel *_model)
updateFeeSectionControls();
updateSmartFeeLabel();

// set default rbf checkbox state
ui->optInRBF->setCheckState(Qt::Checked);

if (model->wallet().hasExternalSigner()) {
//: "device" usually means a hardware wallet.
ui->sendButton->setText(tr("Sign on device"));
Expand Down Expand Up @@ -360,17 +350,12 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
question_string.append("<span style='color:#aa0000; font-weight:bold;'>");
question_string.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
question_string.append("</span><br />");

// append RBF message according to transaction's signalling
question_string.append("<span style='font-size:10pt; font-weight:normal;'>");
if (ui->optInRBF->isChecked()) {
question_string.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125)."));
Comment thread
polespinasa marked this conversation as resolved.
} else {
question_string.append(tr("Not signalling Replace-By-Fee, BIP-125."));
}
question_string.append("</span>");
}

// append RBF message
question_string.append("<span style='font-size:10pt; font-weight:normal;'>");
question_string.append(tr("You can increase the fee later."));
Comment on lines +355 to +357
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if Bitcoin Core is run with -walletrbf=0?

Copy link
Copy Markdown
Member Author

@polespinasa polespinasa May 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have to test to ensure there's no random check that blocks the transaction from being broadcasted but it is redundant.

Anyway there is work ongoing towards deprecating and removing it.
bitcoin/bitcoin#34917

Edit: Just checked and it doesn't matter, the wallet still broadcast it, we are not enforcing RBF even if -walletrbf=0. The only difference is the sequence number value, but has no effect.


// add total amount in all subdivision units
question_string.append("<hr />");
CAmount totalAmount = m_current_transaction->getTotalTransactionAmount() + txFee;
Expand Down Expand Up @@ -834,7 +819,6 @@ void SendCoinsDialog::updateCoinControlState()
// Avoid using global defaults when sending money from the GUI
// Either custom fee will be used or if not selected, the confirmation target from dropdown box
m_coin_control->m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
m_coin_control->m_signal_bip125_rbf = ui->optInRBF->isChecked();
}

void SendCoinsDialog::updateNumberOfBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, SyncType synctype, SynchronizationState sync_state) {
Expand Down
12 changes: 4 additions & 8 deletions src/qt/test/wallettests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,13 @@ void ConfirmSend(QString* text = nullptr, QMessageBox::StandardButton confirm_ty
}

//! Send coins to address and return txid.
Txid SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CTxDestination& address, CAmount amount, bool rbf,
Txid SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CTxDestination& address, CAmount amount,
QMessageBox::StandardButton confirm_type = QMessageBox::Yes)
{
QVBoxLayout* entries = sendCoinsDialog.findChild<QVBoxLayout*>("entries");
SendCoinsEntry* entry = qobject_cast<SendCoinsEntry*>(entries->itemAt(0)->widget());
entry->findChild<QValidatedLineEdit*>("payTo")->setText(QString::fromStdString(EncodeDestination(address)));
entry->findChild<BitcoinAmountField*>("payAmount")->setValue(amount);
sendCoinsDialog.findChild<QFrame*>("frameFee")
->findChild<QFrame*>("frameFeeSelection")
->findChild<QCheckBox*>("optInRBF")
->setCheckState(rbf ? Qt::Checked : Qt::Unchecked);
Txid txid;
btcsignals::scoped_connection c(wallet.NotifyTransactionChanged.connect([&txid](const Txid& hash, ChangeType status) {
if (status == CT_NEW) txid = hash;
Expand Down Expand Up @@ -283,8 +279,8 @@ void TestGUI(interfaces::Node& node, const std::shared_ptr<CWallet>& wallet)
// Send two transactions, and verify they are added to transaction list.
TransactionTableModel* transactionTableModel = walletModel.getTransactionTableModel();
QCOMPARE(transactionTableModel->rowCount({}), 105);
Txid txid1 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 5 * COIN, /*rbf=*/false);
Txid txid2 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 10 * COIN, /*rbf=*/true);
Txid txid1 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 5 * COIN);
Txid txid2 = SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 10 * COIN);
// Transaction table model updates on a QueuedConnection, so process events to ensure it's updated.
qApp->processEvents();
QCOMPARE(transactionTableModel->rowCount({}), 107);
Expand Down Expand Up @@ -424,7 +420,7 @@ void TestGUIWatchOnly(interfaces::Node& node, TestChain100Setup& test)
timer.start(500);

// Send tx and verify PSBT copied to the clipboard.
SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 5 * COIN, /*rbf=*/false, QMessageBox::Save);
SendCoins(*wallet.get(), sendCoinsDialog, PKHash(), 5 * COIN, QMessageBox::Save);
const std::string& psbt_string = QApplication::clipboard()->text().toStdString();
QVERIFY(!psbt_string.empty());

Expand Down
1 change: 0 additions & 1 deletion src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,6 @@ WalletModel::UnlockContext::~UnlockContext()
bool WalletModel::bumpFee(Txid hash, Txid& new_hash)
{
CCoinControl coin_control;
coin_control.m_signal_bip125_rbf = true;
std::vector<bilingual_str> errors;
CAmount old_fee;
CAmount new_fee;
Expand Down
Loading