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
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
I probably need to mention why a dropbox and not a slider.
30@@ -31,6 +31,25 @@
31 #include <QTextDocument>
32 #include <QTimer>
33
34+static const std::array<int, 8> confTargets = { {2, 4, 6, 12, 48, 144, 504, 1008} };
conf_targets
.
30@@ -31,6 +31,25 @@
31 #include <QTextDocument>
32 #include <QTimer>
33
34+static const std::array<int, 8> confTargets = { {2, 4, 6, 12, 48, 144, 504, 1008} };
35+int getConfTargetForIndex(int index) {
36+ if (index+1 > static_cast<int>(confTargets.size())) {
0if (index >= ...
Or just:
0 return conf_targets[max(0, min(conf_targets.size() - 1, index)]
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?
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.
198@@ -177,10 +199,10 @@ void SendCoinsDialog::setModel(WalletModel *_model)
199
200 // set the smartfee-sliders default value (wallets default conf.target or last stored value)
201 QSettings settings;
202- if (settings.value("nSmartFeeSliderPosition").toInt() == 0)
203- ui->sliderSmartFee->setValue(ui->sliderSmartFee->maximum() - model->getDefaultConfirmTarget() + 2);
settings.remove("nSmartFeeSliderPosition")
?
170@@ -152,9 +171,12 @@ void SendCoinsDialog::setModel(WalletModel *_model)
171 coinControlUpdateLabels();
172
173 // fee section
174- connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateSmartFeeLabel()));
175- connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(updateGlobalFeeVariables()));
176- connect(ui->sliderSmartFee, SIGNAL(valueChanged(int)), this, SLOT(coinControlUpdateLabels()));
177+ for (const int &n : confTargets) {
178+ ui->confTargetSelector->addItem(tr("%1 blocks, %2").arg(n).arg(GUIUtil::formatNiceTimeOffset(n*Params().GetConsensus().nPowTargetSpacing)));
"%2 (%1 blocks)"
since the label is Confirmation time
.
30@@ -31,6 +31,25 @@
31 #include <QTextDocument>
32 #include <QTimer>
33
34+static const std::array<int, 11> confTargets = { {2, 3, 4, 5, 6, 12, 24, 48, 144, 504, 1008} };
35+int getConfTargetForIndex(int index) {
getIndexForConfTarget
.
30@@ -31,6 +31,25 @@
31 #include <QTextDocument>
32 #include <QTimer>
33
34+static const std::array<int, 11> confTargets = { {2, 3, 4, 5, 6, 12, 24, 48, 144, 504, 1008} };
Also, why the extra set of {}?
Compiler warning.
45+ for (unsigned int i = 0; i < confTargets.size(); i++) {
46+ if (confTargets[i] >= target) {
47+ return i;
48+ }
49+ }
50+ return confTargets.back();
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.
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.
Always round up (conservative)
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.
jonasschnelli
promag
flack
morcos
luke-jr
gmaxwell
TheBlueMatt
sipa
achow101
Labels
GUI
Milestone
0.15.0