v29.4-roots.3 · Commit 16: [PATCH 16/30] 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. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
src/qt/sendcoinsdialog.cpp
CHANGED
|
@@ -23,6 +23,7 @@
|
|
| 23 |
#include <node/types.h>
|
| 24 |
#include <policy/fees.h>
|
| 25 |
#include <txmempool.h>
|
|
|
|
| 26 |
#include <validation.h>
|
| 27 |
#include <wallet/coincontrol.h>
|
| 28 |
#include <wallet/fees.h>
|
|
@@ -195,8 +196,10 @@ void SendCoinsDialog::setModel(WalletModel *_model)
|
|
| 195 |
updateFeeSectionControls();
|
| 196 |
updateSmartFeeLabel();
|
| 197 |
|
| 198 |
-
// set default rbf checkbox state
|
| 199 |
-
ui->optInRBF->setCheckState(Qt::Checked);
|
|
|
|
|
|
|
| 200 |
|
| 201 |
if (model->wallet().hasExternalSigner()) {
|
| 202 |
//: "device" usually means a hardware wallet.
|
|
@@ -361,16 +364,19 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
|
|
| 361 |
question_string.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
|
| 362 |
question_string.append("</span><br />");
|
| 363 |
|
| 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 |
}
|
| 373 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 374 |
// add total amount in all subdivision units
|
| 375 |
question_string.append("<hr />");
|
| 376 |
CAmount totalAmount = m_current_transaction->getTotalTransactionAmount() + txFee;
|
|
|
|
| 23 |
#include <node/types.h>
|
| 24 |
#include <policy/fees.h>
|
| 25 |
#include <txmempool.h>
|
| 26 |
+
#include <util/rbf.h>
|
| 27 |
#include <validation.h>
|
| 28 |
#include <wallet/coincontrol.h>
|
| 29 |
#include <wallet/fees.h>
|
|
|
|
| 196 |
updateFeeSectionControls();
|
| 197 |
updateSmartFeeLabel();
|
| 198 |
|
| 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());
|
| 203 |
|
| 204 |
if (model->wallet().hasExternalSigner()) {
|
| 205 |
//: "device" usually means a hardware wallet.
|
|
|
|
| 364 |
question_string.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
|
| 365 |
question_string.append("</span><br />");
|
| 366 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
}
|
| 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 |
+
|
| 380 |
// add total amount in all subdivision units
|
| 381 |
question_string.append("<hr />");
|
| 382 |
CAmount totalAmount = m_current_transaction->getTotalTransactionAmount() + txFee;
|