Skip to content

Commit f19ca12

Browse files
committed
Merge #11605: [Wallet] Enable RBF by default in QT
5cbbbd7 [Wallet] Use RBF by default in QT only (Sjors Provoost) Pull request description: ~If there are no objections, this would supersede #11556.~ Enabling RBF by default avoids the need to explain all possible use cases of RBF. This PR does not change the default RPC wallet behavior, as this could break implementations that depend on it and it's not clear what happens when automated services suddenly switch on RBF on a large scale. After trying various approaches, we settled on just having QT ignore `-walletrbf`. Send screen: <img width="388" alt="send" src="https://user-images.githubusercontent.com/10217/34251097-329c8dee-e63f-11e7-9e14-d7f55d2b52cc.png"> Confirmation screen by default (with RBF): <img width="429" alt="rbf yes" src="https://user-images.githubusercontent.com/10217/32442799-f50d54aa-c2fc-11e7-9392-96339d0f1f74.png"> Confirmation screen without RBF: <img width="431" alt="rf no" src="https://user-images.githubusercontent.com/10217/32442793-ef30bc34-c2fc-11e7-8ca2-e86a97175278.png"> Tree-SHA512: 53efb5d277144478143e69dcae8112c1b9c2beb981fdd0fe778592e5f7d5bf838f73d48052ead874586a75b944e8af469b25e5f376c135cf48cc3598e77f5891
2 parents 180a255 + 5cbbbd7 commit f19ca12

File tree

6 files changed

+19
-16
lines changed

6 files changed

+19
-16
lines changed

doc/release-notes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ Due to a backward-incompatible change in the wallet database, wallets created
6767
with version 0.16.0 will be rejected by previous versions. Also, version 0.16.0
6868
will only create hierarchical deterministic (HD) wallets.
6969

70+
Replace-By-Fee by default in GUI
71+
--------------------------------
72+
The send screen now uses BIP-125 RBF by default, regardless of `-walletrbf`.
73+
There is a checkbox to mark the transaction as final.
74+
75+
The RPC default remains unchanged: to use RBF, launch with `-walletrbf=1` or
76+
use the `replaceable` argument for individual transactions.
77+
7078
Custom wallet directories
7179
---------------------
7280
The ability to specify a directory other than the default data directory in which to store

src/qt/forms/sendcoinsdialog.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,10 +1108,10 @@
11081108
<item>
11091109
<widget class="QCheckBox" name="optInRBF">
11101110
<property name="text">
1111-
<string>Allow increasing fee</string>
1111+
<string>Enable Replace-By-Fee</string>
11121112
</property>
11131113
<property name="toolTip">
1114-
<string>This allows you to increase the fee later if the transaction takes a long time to confirm. This will also cause the recommended fee to be lower. ("Replace-By-Fee", BIP 125)</string>
1114+
<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>
11151115
</property>
11161116
</widget>
11171117
</item>

src/qt/sendcoinsdialog.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void SendCoinsDialog::setModel(WalletModel *_model)
181181
updateSmartFeeLabel();
182182

183183
// set default rbf checkbox state
184-
ui->optInRBF->setCheckState(model->getDefaultWalletRbf() ? Qt::Checked : Qt::Unchecked);
184+
ui->optInRBF->setCheckState(Qt::Checked);
185185

186186
// set the smartfee-sliders default value (wallets default conf.target or last stored value)
187187
QSettings settings;
@@ -339,12 +339,14 @@ void SendCoinsDialog::on_sendButton_clicked()
339339
questionString.append(QString("<span style='font-size:10pt;font-weight:normal;'><br />(=%2)</span>")
340340
.arg(alternativeUnits.join(" " + tr("or") + "<br />")));
341341

342-
if (ui->optInRBF->isChecked())
343-
{
344-
questionString.append("<hr /><span>");
345-
questionString.append(tr("You can increase the fee later (signals Replace-By-Fee)."));
346-
questionString.append("</span>");
342+
questionString.append("<hr /><span>");
343+
if (ui->optInRBF->isChecked()) {
344+
questionString.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125)."));
345+
} else {
346+
questionString.append(tr("Not signalling Replace-By-Fee, BIP-125."));
347347
}
348+
questionString.append("</span>");
349+
348350

349351
SendConfirmationDialog confirmationDialog(tr("Confirm send coins"),
350352
questionString.arg(formatted.join("<br />")), SEND_CONFIRM_DELAY, this);

src/qt/walletmodel.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,3 @@ int WalletModel::getDefaultConfirmTarget() const
737737
{
738738
return nTxConfirmTarget;
739739
}
740-
741-
bool WalletModel::getDefaultWalletRbf() const
742-
{
743-
return fWalletRbf;
744-
}

src/qt/walletmodel.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,6 @@ class WalletModel : public QObject
216216

217217
int getDefaultConfirmTarget() const;
218218

219-
bool getDefaultWalletRbf() const;
220-
221219
private:
222220
CWallet *wallet;
223221
bool fHaveWatchOnly;

src/wallet/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ std::string GetWalletHelpString(bool showDebug)
3131
strUsage += HelpMessageOpt("-salvagewallet", _("Attempt to recover private keys from a corrupt wallet on startup"));
3232
strUsage += HelpMessageOpt("-spendzeroconfchange", strprintf(_("Spend unconfirmed change when sending transactions (default: %u)"), DEFAULT_SPEND_ZEROCONF_CHANGE));
3333
strUsage += HelpMessageOpt("-txconfirmtarget=<n>", strprintf(_("If paytxfee is not set, include enough fee so transactions begin confirmation on average within n blocks (default: %u)"), DEFAULT_TX_CONFIRM_TARGET));
34-
strUsage += HelpMessageOpt("-walletrbf", strprintf(_("Send transactions with full-RBF opt-in enabled (default: %u)"), DEFAULT_WALLET_RBF));
34+
strUsage += HelpMessageOpt("-walletrbf", strprintf(_("Send transactions with full-RBF opt-in enabled (RPC only, default: %u)"), DEFAULT_WALLET_RBF));
3535
strUsage += HelpMessageOpt("-upgradewallet", _("Upgrade wallet to latest format on startup"));
3636
strUsage += HelpMessageOpt("-wallet=<file>", _("Specify wallet file (within data directory)") + " " + strprintf(_("(default: %s)"), DEFAULT_WALLET_DAT));
3737
strUsage += HelpMessageOpt("-walletbroadcast", _("Make the wallet broadcast transactions") + " " + strprintf(_("(default: %u)"), DEFAULT_WALLETBROADCAST));

0 commit comments

Comments
 (0)