v29.4-roots.4 · Commit 16: [PATCH 16/37] feat(qt): add per-send RBF override
src/qt/sendcoinsdialog.cpp
Before: src/qt/sendcoinsdialog.cpp · After: src/qt/sendcoinsdialog.cpp
File metadata
index 55349b1fca0ac719d217b7e57032d774b4a3c9ac..ae6d58eba31493ff89a4887472a432cfff7ee320 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>
|
|
@@ -195,8 +196,10 @@ void SendCoinsDialog::setModel(WalletModel *_model)
|
|
|
195
196
|
updateFeeSectionControls();
|
|
196
197
|
updateSmartFeeLabel();
|
|
197
198
|
|
|
198
|
-
// set default rbf checkbox state
|
|
199
|
-
ui->optInRBF->setCheckState(Qt::Checked);
|
|
199
|
+
// Initialize the one-send override from the wallet default. The
|
|
200
|
+
// checkbox remains explicit, so updateCoinControlState() always
|
|
201
|
+
// passes its selected value to transaction creation.
|
|
202
|
+
ui->optInRBF->setChecked(model->wallet().getDefaultRbf());
|
|
200
203
|
|
|
201
204
|
if (model->wallet().hasExternalSigner()) {
|
|
202
205
|
//: "device" usually means a hardware wallet.
|
|
@@ -361,16 +364,19 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
|
|
|
361
364
|
question_string.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
|
|
362
365
|
question_string.append("</span><br />");
|
|
363
366
|
|
|
364
|
-
// append RBF message according to transaction's signalling
|
|
365
|
-
question_string.append("<span style='font-size:10pt; font-weight:normal;'>");
|
|
366
|
-
if (ui->optInRBF->isChecked()) {
|
|
367
|
-
question_string.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125)."));
|
|
368
|
-
} else {
|
|
369
|
-
question_string.append(tr("Not signalling Replace-By-Fee, BIP-125."));
|
|
370
|
-
}
|
|
371
|
-
question_string.append("</span>");
|
|
372
367
|
}
|
|
373
368
|
|
|
369
|
+
// Show the signaling in the prepared transaction, rather than the
|
|
370
|
+
// requested value, so the confirmation states the effective result even
|
|
371
|
+
// when no fee is required.
|
|
372
|
+
question_string.append("<span style='font-size:10pt; font-weight:normal;'>");
|
|
373
|
+
if (SignalsOptInRBF(*m_current_transaction->getWtx())) {
|
|
374
|
+
question_string.append(tr("This transaction signals Replace-By-Fee (BIP-125). Replacement acceptance depends on network policy."));
|
|
375
|
+
} else {
|
|
376
|
+
question_string.append(tr("Not signalling Replace-By-Fee, BIP-125."));
|
|
377
|
+
}
|
|
378
|
+
question_string.append("</span>");
|
|
379
|
+
|
|
374
380
|
// add total amount in all subdivision units
|
|
375
381
|
question_string.append("<hr />");
|
|
376
382
|
CAmount totalAmount = m_current_transaction->getTotalTransactionAmount() + txFee;
|