Skip to content

Conversation

jonasschnelli
Copy link
Contributor

Addresses #10590.

This PR replaces the fee slider with a Dropbox box. The Dropdown contains the target in ~blocks and ~estimated time to confirm.

The current supported confirmation targets are: 2, 4, 6, 12, 48, 144, 504, 1008

bildschirmfoto 2017-07-07 um 21 56 19

@jonasschnelli
Copy link
Contributor Author

I probably need to mention why a dropbox and not a slider.

  • Sliders tend to be linear (otherwise nobody would understand them and I bet it would require a custom, non standard UI object) which would make it useless if we would support conf. targets up to 1008.
  • A dropbox allows one to give a better overview (slider: you only see the underlaying value if you change it).
  • Dropbox would allow to show the feerate and or a text ("fast", "economy", etc,), ... and eventual the absolute fee by running the coin-selections if the parameters are provided.

@@ -31,6 +31,25 @@
#include <QTextDocument>
#include <QTimer>

static const std::array<int, 8> confTargets = { {2, 4, 6, 12, 48, 144, 504, 1008} };
Copy link
Contributor

Choose a reason for hiding this comment

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

Rename conf_targets.

@@ -31,6 +31,25 @@
#include <QTextDocument>
#include <QTimer>

static const std::array<int, 8> confTargets = { {2, 4, 6, 12, 48, 144, 504, 1008} };
int getConfTargetForIndex(int index) {
if (index+1 > static_cast<int>(confTargets.size())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (index >= ...

Copy link
Contributor

Choose a reason for hiding this comment

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

Or just:

  return conf_targets[max(0, min(conf_targets.size() - 1, index)]

@flack
Copy link
Contributor

flack commented Jul 8, 2017

Looking at the screenshot, I would drop the tilde before the number of blocks, i.e. 2 Blocks, ~20 minutes instead of ~2 Blocks, ~20 minutes. It already says "confirmation target", so it should be obvious that it's not exactly x blocks. In other words, make it say "target x blocks (approx. y minutes)" instead of "target approx. x blocks (approx. y minutes)".

Also, shouldn't blocks have a lowercase b?

@morcos
Copy link
Contributor

morcos commented Jul 8, 2017

Will review shortly. Thanks for doing!

Also please add a target for 24 for compatibility with the old estimates (where 25 was the highest possible target). It may be a target that people are used to using.

@luke-jr
Copy link
Member

luke-jr commented Jul 8, 2017

Confirmation is when it's 6 blocks deep, so +5 to all the numbers here? Or change it to "begin confirmation" like we currently have...

@gmaxwell
Copy link
Contributor

gmaxwell commented Jul 9, 2017

I like how it looks, @morcos any concerns about missing 3,5 making users fee choices more clumpy?

@jonasschnelli jonasschnelli added this to the 0.15.0 milestone Jul 9, 2017
@jonasschnelli jonasschnelli force-pushed the 2017/07/qt_fee_slider branch 2 times, most recently from 979cd99 to 19eae9c Compare July 10, 2017 14:41
@jonasschnelli
Copy link
Contributor Author

Re-added targets 3, 5, 24 and removed the tilde in front of the target-in-blocks/-time.

@@ -177,10 +199,10 @@ void SendCoinsDialog::setModel(WalletModel *_model)

// set the smartfee-sliders default value (wallets default conf.target or last stored value)
QSettings settings;
if (settings.value("nSmartFeeSliderPosition").toInt() == 0)
ui->sliderSmartFee->setValue(ui->sliderSmartFee->maximum() - model->getDefaultConfirmTarget() + 2);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should call settings.remove("nSmartFeeSliderPosition")?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm... I think an addition is required: we probably need to migrate the old slider value to the new dropdown?

Copy link
Contributor

Choose a reason for hiding this comment

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

That doesn't seem particularly important to me.

connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateGlobalFeeVariables()));
connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(coinControlUpdateLabels()));
for (const int &n : confTargets) {
ui->confTargetSelector->addItem(tr("%1 blocks, %2").arg(n).arg(GUIUtil::formatNiceTimeOffset(n*Params().GetConsensus().nPowTargetSpacing)));
Copy link
Contributor

Choose a reason for hiding this comment

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

Alternative format: "%2 (%1 blocks)" since the label is Confirmation time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Your right.. will fix.

@@ -31,6 +31,25 @@
#include <QTextDocument>
#include <QTimer>

static const std::array<int, 11> confTargets = { {2, 3, 4, 5, 6, 12, 24, 48, 144, 504, 1008} };
int getConfTargetForIndex(int index) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Update block style. Same for getIndexForConfTarget.

@@ -31,6 +31,25 @@
#include <QTextDocument>
#include <QTimer>

static const std::array<int, 11> confTargets = { {2, 3, 4, 5, 6, 12, 24, 48, 144, 504, 1008} };
Copy link
Contributor

Choose a reason for hiding this comment

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

Snake case.

@morcos
Copy link
Contributor

morcos commented Jul 10, 2017

ACK 19eae9c

@gmaxwell Actually my preference would be to remove the 3 and 5 targets. I think it gives a false sense of accuracy with the estimates. I don't imagine much clumping concern as those estimates often aren't that different from each other and there is a much larger range of estimates to choose from as well as time variability. I also think its a bit cleaner not to be faced with too many choices in a dropdown.

Copy link
Contributor

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Really think we need this for 15.

@@ -31,6 +31,25 @@
#include <QTextDocument>
#include <QTimer>

static const std::array<int, 11> confTargets = { {2, 3, 4, 5, 6, 12, 24, 48, 144, 504, 1008} };
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: not sure its worth having 5 here, maybe not 3 either.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, why the extra set of {}?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, why the extra set of {}?

Compiler warning.

return i;
}
}
return confTargets.back();
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you meant .size() - 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh. Yes. Will fix.

@sipa
Copy link
Member

sipa commented Jul 12, 2017

GUI-screenshot-looks-nice-ACK. Didn't look at the code.

@achow101
Copy link
Member

utACK 19eae9c3602c784d55f8edc94300da1ece686a6c modulo the thing @TheBlueMatt pointed out.

I don't think we need the 3, 4, or 5 block target estimates.

It may also be useful to include a tooltip that explains why you see the line "Estimated to begin confirmation within N blocks" where N is less than the confirmation target that you chose as seen in the screenshot below. This discrepancy may confuse users.

image

@morcos
Copy link
Contributor

morcos commented Jul 12, 2017

tooltip that explains why you see the line "Estimated to begin confirmation within N blocks" where N is less than the confirmation target that you chose

Yes would be a nice improvement, could be left for another PR as it's a preexisting issue. Would be great to get than in for 0.15 as well, but wouldn't want it to hold up this.

The other feature that I'd ideally like is the ability to force estimates conservative or economical regardless of the Replace-By-Fee setting. Again just a wish list item.

@jonasschnelli jonasschnelli force-pushed the 2017/07/qt_fee_slider branch from 19eae9c to ff54ece Compare July 13, 2017 10:20
@jonasschnelli jonasschnelli force-pushed the 2017/07/qt_fee_slider branch from ff54ece to 2aef1f1 Compare July 13, 2017 10:21
@jonasschnelli
Copy link
Contributor Author

Removed again target 3 and 5 and fixed points found by @TheBlueMatt and @promag.
Added another commit that add a tiny migration logic.

Thanks for a retest/re-ack.

@morcos
Copy link
Contributor

morcos commented Jul 13, 2017

Tested ACK 2aef1f1

@TheBlueMatt
Copy link
Contributor

utACK 2aef1f1

@sipa sipa merged commit 2aef1f1 into bitcoin:master Jul 15, 2017
sipa added a commit that referenced this pull request Jul 15, 2017
…argets

2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli)
bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli)

Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
@jonasschnelli jonasschnelli mentioned this pull request Jul 31, 2017
12 tasks
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Aug 6, 2019
…conf. targets

2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli)
bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli)

Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Aug 6, 2019
…conf. targets

2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli)
bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli)

Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Aug 6, 2019
…conf. targets

2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli)
bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli)

Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Aug 7, 2019
…conf. targets

2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli)
bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli)

Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Aug 8, 2019
…conf. targets

2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli)
bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli)

Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Aug 12, 2019
…conf. targets

2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli)
bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli)

Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
barrystyle pushed a commit to PACGlobalOfficial/PAC that referenced this pull request Jan 22, 2020
…conf. targets

2aef1f1 [Qt] migrate old fee slider value to new dropbown Always round up (conservative) (Jonas Schnelli)
bc1be90 [Qt] replace fee slider with a Dropdown, extend conf. targets (Jonas Schnelli)

Tree-SHA512: 53796cf0b434dd3db5d4680dbeb6231a7df8f15d88187178fd4db8917cd7fc60091ce2c1589fd93668fc94bb13f989aba5b7ef3792fa95ee1f9f21a15709e2d3
@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.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants