Skip to content

[Qt] Add checkbox in the GUI to opt-in to RBF when creating a transaction - #9592

Merged
jonasschnelli merged 3 commits into
bitcoin:masterfrom
ryanofsky:pr/grbf
Mar 17, 2017
Merged

[Qt] Add checkbox in the GUI to opt-in to RBF when creating a transaction#9592
jonasschnelli merged 3 commits into
bitcoin:masterfrom
ryanofsky:pr/grbf

Conversation

@ryanofsky

Copy link
Copy Markdown
Contributor

The first three commits come from @jonasschnelli's PR #8182

@jonasschnelli jonasschnelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

utACK 054264a modulo send-dialog-confirmation text overhaul.

Comment thread src/qt/sendcoinsdialog.cpp Outdated
if (ui->optInRBF->isChecked())
{
questionString.append("<hr /><span style='color:#aa0000;'>");
questionString.append(tr("This transaction is replacable (optin-RBF)!"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For clarity, we should probably use This transactions signals replaceability (optin-RBF)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This red warning with exclamation point is overly alarming. It almost implies it's dangerous to you that its replaceable. Transactions you send that are replaceable are not something to be warned about. Worst case someone doesn't accept them, and you can replace it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure we need to specially say anything here, but something more like "This transaction may be replaced." sounds nicer.

@ryanofsky ryanofsky Jan 23, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed spelling of replaceable, removed exclamation point and red highlight in 8924813.

Comment thread src/qt/sendcoinsdialog.cpp Outdated
ui->groupCustomFee->button((int)std::max(0, std::min(1, settings.value("nCustomFeeRadio").toInt())))->setChecked(true);
ui->customFee->setValue(settings.value("nTransactionFee").toLongLong());
ui->checkBoxMinimumFee->setChecked(settings.value("fPayOnlyMinFee").toBool());
ui->optInRBF->setCheckState(fWalletRbf ? Qt::Checked : Qt::Unchecked);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: we should probably access fWalletRbf over WalletModel (not directly over the global space).

@ryanofsky ryanofsky Jan 23, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in f8193e2.

@morcos

morcos commented Jan 20, 2017

Copy link
Copy Markdown
Contributor

concept ACK
and lightly tested without problems

Comment thread src/qt/forms/sendcoinsdialog.ui Outdated
</item>
<item>
<widget class="QCheckBox" name="optInRBF">
<property name="text">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/Allow/Request/

@ryanofsky ryanofsky Jan 23, 2017

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 0936ced.

Comment thread src/qt/forms/sendcoinsdialog.ui Outdated
<property name="text">
<string>Allow Replace-By-Fee</string>
</property>
<property name="toolTip">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"Indicates that the sender may wish to replace this transaction with a new one paying higher fees (prior to being confirmed)."

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 36548fc.

Comment thread src/qt/sendcoinsdialog.cpp Outdated
if (ui->optInRBF->isChecked())
{
questionString.append("<hr /><span style='color:#aa0000;'>");
questionString.append(tr("This transaction is replacable (optin-RBF)!"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure we need to specially say anything here, but something more like "This transaction may be replaced." sounds nicer.

Comment thread src/qt/walletmodel.h Outdated

// prepare transaction for getting txfee before sending coins
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl = NULL);
SendCoinsReturn prepareTransaction(WalletModelTransaction &transaction, const CCoinControl *coinControl = NULL, bool optInRBF = false);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This changes the default behaviour. Presently, it uses fWalletRbf, but now it will become !RBF always.

Is there a reason not to pass this through CCoinControl?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added to coincontrol in 74a594d.

Comment thread src/wallet/wallet.cpp Outdated
// to avoid conflicting with other possible uses of nSequence,
// and in the spirit of "smallest posible change from prior
// behavior."
bool rbf = (flags & CREATE_TX_ENABLE_RBF || ::fWalletRbf) && !(flags & CREATE_TX_DISABLE_RBF);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This would be more readable as:

bool rbf = ::fWalletRbf;
if (flags & CREATE_TX_ENABLE_RBF) {
    rbf = true;
} else if (flags & CREATE_TX_DISABLE_RBF) {
    rbf = false;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Simplified with switch to coincontrol in 74a594d.

Comment thread src/wallet/wallet.h Outdated

enum CreateTransactionFlags {
CREATE_TX_DEFAULT = 0,
CREATE_TX_DONT_SIGN = (1U << 0),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please invert this. Not only is it unintuitive to have it backward, it also contradicts the current function signature (that is, passing true or false will silently get the opposite behaviour).

    CREATE_TX_DEFAULT = 1,
    CREATE_TX_SIGN = 1,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted for switch to coin control in 2fce406.

@jtimon

jtimon commented Jan 23, 2017

Copy link
Copy Markdown
Contributor

Concept ACK

ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jan 23, 2017
Add signalRbf option to CCoinControl as suggested by
Luke Dashjr <luke-jr+git@utopios.org> in
bitcoin#9592 (comment)
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jan 23, 2017
Set signalRbf via CCoinControl as suggested by
Luke Dashjr <luke-jr+git@utopios.org> in
bitcoin#9592 (comment)
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jan 23, 2017
s/Allow/Request/ as suggested by Luke Dashjr <luke-jr+git@utopios.org> in
bitcoin#9592 (comment)
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jan 23, 2017
Change RBF tooltip as suggested by Luke Dashjr <luke-jr+git@utopios.org> in
bitcoin#9592 (comment)
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jan 23, 2017
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jan 23, 2017
Access fWalletRbf global through WalletModel as suggested by
Jonas Schnelli <dev@jonasschnelli.ch> in
bitcoin#9592 (comment)
@ryanofsky

Copy link
Copy Markdown
Contributor Author

Squashed 95bec7a -> 92b9ff6.

Comment thread src/qt/sendcoinsdialog.cpp Outdated
if (ui->optInRBF->isChecked())
{
questionString.append("<hr /><span>");
questionString.append(tr("This transaction is replaceable (optin-RBF)."));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What about using This transaction signals replaceability?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in 8f728d0.

@jonasschnelli

Copy link
Copy Markdown
Contributor

Tested ACK 92b9ff6.

With a German UI, the text can look a bit strange (see screenshot).
Maybe we can add some pixels right margin?
bildschirmfoto 2017-01-24 um 09 28 57

Screenshots:

bildschirmfoto 2017-01-24 um 09 38 32

bildschirmfoto 2017-01-24 um 09 38 37

Possible follow-up work:
-> Add a UI option for the global -walletrbf flag.
-> Maybe persist the checkbox state (state should probably survives restarts, = strong -walletrbf in GUI settings)

@aesedepece

Copy link
Copy Markdown

I'm wondering whether it would make more sense to put the RBF checkbox next to the fee options instead. That would definitely avoid the layout issue with "verbose" languages like German or Spanish.

Think about it. We all know that RBF allows replacing transaction A with transaction B as long as A has no confirmations yet and B includes a higher fee. Nevertheless, as far as I know, the intended use case for RBF in Core is only to allow the user to increase the fee afterwards from the transactions history view by right-clicking, pressing "Increase fee..." and selecting a higher fee.

My point is that the user will not perceive the transaction being replaced but rather being "upgraded". That's why I believe that from an UX point of view, RBF is more related to fees than to a transaction as a whole, and therefore putting the checkbox in the fees frame makes much more sense to me.

@jonasschnelli

Copy link
Copy Markdown
Contributor

I think @aesedepece made a good point. Moving it into the fee section makes sense.

ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jan 24, 2017
ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jan 24, 2017

@ryanofsky ryanofsky left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved checkbox into fee section in fac1f09.

Comment thread src/qt/sendcoinsdialog.cpp Outdated
if (ui->optInRBF->isChecked())
{
questionString.append("<hr /><span>");
questionString.append(tr("This transaction is replaceable (optin-RBF)."));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated in 8f728d0.

@jonasschnelli

Copy link
Copy Markdown
Contributor

Now the labels misses some bottom margin.

bildschirmfoto 2017-01-24 um 21 28 42

This should fix it:

diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui
index a633478..e25fe05 100644
--- a/src/qt/forms/sendcoinsdialog.ui
+++ b/src/qt/forms/sendcoinsdialog.ui
@@ -1178,8 +1178,8 @@
           </property>
           <property name="sizeHint" stdset="0">
            <size>
-            <width>800</width>
-            <height>1</height>
+            <width>40</width>
+            <height>5</height>
            </size>
           </property>
          </spacer>

ryanofsky added a commit to ryanofsky/bitcoin that referenced this pull request Jan 25, 2017
jonasschnelli and others added 2 commits January 25, 2017 12:51
Before this commit, the checkbox would always start off unchecked. After this
commit it will respect the -walletrbf setting (which is currently false by
default).
@ryanofsky

Copy link
Copy Markdown
Contributor Author

Thanks added in f4aac9e, confirmed the change does improve the spacing, and squashed f4aac9e -> c4e4792 (grbf.5 -> grbf.6)

@jonasschnelli jonasschnelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(again) Tested ACK c4e4792

if (ui->optInRBF->isChecked())
{
questionString.append("<hr /><span>");
questionString.append(tr("This transaction signals replaceability (optin-RBF)."));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still think this is likely to confuse users. Why must we say so here? (The alternative case seems much more of a liability...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jonasschnelli or others, you should comment if you think the "This transaction signals replaceability" text is useful, otherwise I'm fine with removing it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know whats best here.
Somehow I agree with @luke-jr that it would probably be better the label non-RBF transactions (something like "this transaction signals to be final"), but meh.

We also need to respect that RBF is deployed as a new feature and maybe users are expecting to see wether the new features is enabled or not.

So, no strong opinion. The PRs current solution seems acceptable to me.

@ryanofsky

Copy link
Copy Markdown
Contributor Author

This PR has several ACKs. Should it be merged?

@luke-jr

luke-jr commented Mar 8, 2017

Copy link
Copy Markdown
Contributor

Probably needs a GUI way to actually use it first.

@ryanofsky

Copy link
Copy Markdown
Contributor Author

Probably needs a GUI way to actually use it first.

In that case, this should not be merged until #9697 is merged. Would note though that there is no "GUI way" to use #9697 without this PR, so the dependency is somewhat circular.

@luke-jr

luke-jr commented Mar 8, 2017

Copy link
Copy Markdown
Contributor

Merging them at the same time seems logical.

@laanwj

laanwj commented Mar 14, 2017

Copy link
Copy Markdown
Member

Adding 0.15 milestone

@jonasschnelli

Copy link
Copy Markdown
Contributor

Going to merge this (even without #9697). A) it can make sense without a Qt bumper (at least you can bump over the console) and B) I don't want to kick this back to a rebase phase.

@jonasschnelli
jonasschnelli merged commit c4e4792 into bitcoin:master Mar 17, 2017
jonasschnelli added a commit that referenced this pull request Mar 17, 2017
…ing a transaction

c4e4792 [Qt] Change RBF checkbox to reflect -walletrbf setting (Russell Yanofsky)
838a58e [Qt] Add simple optin-RBF checkbox and confirmation info (Jonas Schnelli)
568c05a Allow to opt-into RBF when creating a transaction (Jonas Schnelli)

Tree-SHA512: 3d52dcd4e44da8aed4d631748074afef78d38c860f2a8b95323f4801a989d6599a3498a753fc10daba4098c527ef5a0eb942e5b3f1bfd656e1a6bd272b8e6c57
@maflcko maflcko mentioned this pull request Mar 19, 2017
12 tasks
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants