Skip to content
Bitcoin Roots

v30.3-roots.1 · Commit 16: [PATCH 16/68] feat(qt): add per-send RBF override

src/qt/sendcoinsdialog.cpp

Before: src/qt/sendcoinsdialog.cpp · After: src/qt/sendcoinsdialog.cpp

File metadata
index fd1fd2f0f1c0244ada28e7ba5138cf3c8ff19149..8fea0af8e27d7852f6e5df6d02532a928bf9339f 100644

Download original patch · Release notes

Diff rows 1–46 of 46. Line numbers refer to the original before/after files.

+ Added− RemovedUnmarked lines are context.

Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.

src/qt/sendcoinsdialog.cpp CHANGED
@@ -23,6 +23,7 @@
23
23
  #include <node/types.h>
24
24
  #include <policy/fees.h>
25
25
  #include <txmempool.h>
26
+ #include <util/rbf.h>
26
27
  #include <validation.h>
27
28
  #include <wallet/coincontrol.h>
28
29
  #include <wallet/fees.h>
@@ -199,8 +200,10 @@ void SendCoinsDialog::setModel(WalletModel *_model)
199
200
  updateFeeSectionControls();
200
201
  updateSmartFeeLabel();
201
202
 
202
- // set default rbf checkbox state
203
- ui->optInRBF->setCheckState(Qt::Checked);
203
+ // Initialize the one-send override from the wallet default. The
204
+ // checkbox remains explicit, so updateCoinControlState() always
205
+ // passes its selected value to transaction creation.
206
+ ui->optInRBF->setChecked(model->wallet().getDefaultRbf());
204
207
 
205
208
  if (model->wallet().hasExternalSigner()) {
206
209
  //: "device" usually means a hardware wallet.
@@ -365,16 +368,19 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
365
368
  question_string.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
366
369
  question_string.append("</span><br />");
367
370
 
368
- // append RBF message according to transaction's signalling
369
- question_string.append("<span style='font-size:10pt; font-weight:normal;'>");
370
- if (ui->optInRBF->isChecked()) {
371
- question_string.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125)."));
372
- } else {
373
- question_string.append(tr("Not signalling Replace-By-Fee, BIP-125."));
374
- }
375
- question_string.append("</span>");
376
371
  }
377
372
 
373
+ // Show the signaling in the prepared transaction, rather than the
374
+ // requested value, so the confirmation states the effective result even
375
+ // when no fee is required.
376
+ question_string.append("<span style='font-size:10pt; font-weight:normal;'>");
377
+ if (SignalsOptInRBF(*m_current_transaction->getWtx())) {
378
+ question_string.append(tr("This transaction signals Replace-By-Fee (BIP-125). Replacement acceptance depends on network policy."));
379
+ } else {
380
+ question_string.append(tr("Not signalling Replace-By-Fee, BIP-125."));
381
+ }
382
+ question_string.append("</span>");
383
+
378
384
  // add total amount in all subdivision units
379
385
  question_string.append("<hr />");
380
386
  CAmount totalAmount = m_current_transaction->getTotalTransactionAmount() + txFee;