







25@@ -26,9 +26,11 @@ using namespace std;
26 CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE);
27 unsigned int nTxConfirmTarget = 1;
28 bool bSpendZeroConfChange = true;
29+bool fSendFreeTransactions = true;
30+bool fPayAtLeastCustomFee = true;
31
32 /** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */
33-CFeeRate CWallet::minTxFee = CFeeRate(10000); // Override with -mintxfee
34+CFeeRate CWallet::minTxFee = CFeeRate(1000); // Override with -mintxfee
Sure, its intentional, we have reduced the minrelayfee from 10000 to 1000 satoshis in 0.9. But this did not make transactions cheaper for the people, because the wallet still paid 10000 (which is good, to ensure everybodys txs get relayed). After the 0.9 release there were even blogs about “How to make your bitcoin transactions cheaper”, they told people to start bitcoin with -mintxfee=0.00001000 (1000 satoshis). Back then this was a little dangerous, as your tx may not be relayed, but now its safe. This is just the second step of staging.
So, yes, we should definitely reduce the mintxfee to 1000 satoshis for the 0.10 release, See #3305.
Bitcoin transactions are super cheap these days as we also removed the rounding, a 192 bytes transaction only costs 192 satoshis. Its actually 1 satoshi per byte.
140+ sortView(settings.value("nCoinControlSortColumn").toInt(), ((Qt::SortOrder)settings.value("nCoinControlSortOrder").toInt()));
141 }
142
143 CoinControlDialog::~CoinControlDialog()
144 {
145+ QSettings settings;
I am not completely objected to that idea, but on the other hand the values get written to disk in the QSettings destructor, so if we had a guiutil-function we would flush to disk on every call for no reason really.
And as for the writings we would replace 1 line
0settings.setValue(key, value);
with 1 line
0GUIUtil::setQSetting(key, value);
which is not that much of an improvement.
But if you have an idea, feel free to submit an improvement pull request afterwards.
130@@ -130,10 +131,22 @@ CoinControlDialog::CoinControlDialog(QWidget *parent) :
131
132 // default view is sorted by amount desc
133 sortView(COLUMN_AMOUNT_INT64, Qt::DescendingOrder);
134+
135+ // restore list mode and sortorder as a convenience feature
136+ QSettings settings;
137+ if (settings.contains("nCoinControlMode") && settings.value("nCoinControlMode").toInt() == 1)
302@@ -290,19 +303,19 @@ void CoinControlDialog::clipboardAmount()
303 // copy label "Fee" to clipboard
304 void CoinControlDialog::clipboardFee()
305 {
306- GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(" ")));
307+ GUIUtil::setClipboard(ui->labelCoinControlFee->text().left(ui->labelCoinControlFee->text().indexOf(" ")).replace("~",""));
436- return ">=" + tr("medium");
437- return tr("lowest");
438+ double dPriorityMedium = mempool.estimatePriority(nTxConfirmTarget);
439+
440+ if (dPriorityMedium <= 0)
441+ dPriorityMedium = COIN * 144 / 250; // not enough data, back to hard-coded
261- {
262- /* Update transactionFee with the current unit */
263- ui->transactionFee->setDisplayUnit(model->getDisplayUnit());
264- }
265-}
266+void OptionsDialog::updateDisplayUnit() {}
11 #include "coincontroldialog.h"
12 #include "guiutil.h"
13 #include "optionsmodel.h"
14 #include "sendcoinsentry.h"
15 #include "walletmodel.h"
16+#include "wallet.h"
595+ }
596+}
597+
598+void SendCoinsDialog::updateMinFeeLabel()
599+{
600+ ui->labelMinFee->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), CWallet::minTxFee.GetFeePerK()) + "/kB");
588+ if (ui->radioSmartFee->isChecked())
589+ ui->labelFeeMinimized->setText(ui->labelSmartFee->text());
590+ else if (ui->radioMinimumFee->isChecked())
591+ ui->labelFeeMinimized->setText(ui->labelMinFee->text());
592+ else {
593+ ui->labelFeeMinimized->setText(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), ui->customFee->value()) +
433- // Note: if mempool hasn't accumulated enough history (estimatePriority
434- // returns -1) we're conservative and classify as "lowest"
435- if (mempool.estimatePriority(nTxConfirmTarget) <= 0 && AllowFree(dPriority))
436- return ">=" + tr("medium");
437- return tr("lowest");
438+ double dPriorityMedium = mempool.estimatePriority(nTxConfirmTarget);
updateLabels
and updateView
since its just the same call over and over again for each input.
86+ if (!settings.contains("nCustomRadio") && settings.contains("nTransactionFee") && settings.value("nTransactionFee").toLongLong() > 0) // compatibility
87+ settings.setValue("nCustomRadio", 1); // at least
88+ if (!settings.contains("nCustomRadio"))
89+ settings.setValue("nCustomRadio", 0); // per kilobyte
90+ if (!settings.contains("nTxConfirmTarget"))
91+ settings.setValue("nTxConfirmTarget", 0);
nTxConfirmTarget
right? This is how far over the slider is set?
554- if (dPriorityNeeded <= 0 && !AllowFree(dPriority)) // not enough mempool history: never send free
555- dPriorityNeeded = std::numeric_limits<double>::max();
556+ if (fSendFreeTransactions)
557+ {
558+ double dPriorityNeeded = mempool.estimatePriority(nTxConfirmTarget);
559+ if (dPriorityNeeded <= 0 && !AllowFree(dPriority)) // not enough mempool history: never send free
AllowFree
is a good default here, that’s the minimum possible priority to be included in a block, but isn’t any indication that it’s ever going to happen.
Yes, I also thought that maybe we shouldnt allow free transactions by the hardcoded priority at all. On the other hand, smartfee needs some people to send free transactions in order to have a reference.
But this is the wrong pull request for this discussion, here coincontrol just needs to follow CWallet:CreateTransaction. If you want that to be changed, please create a separate issue for it, as this would require CWallet:CreateTransaction to be changed.
Looks good to me!
A question: “Send as free transaction if possible” - doesn’t this toggle apply to all three settings equally, Recommended Minimum and Custom? That feels more logical to me.
Some minor nits:
Grammatical corrections:
What is the difference between “Send as free transaction if possible” and “Minimum”? They sound like the same thing to me…
@cozz “free transaction relay” has been used for nodes that don’t perform IsStandard filtering of transactions. It’s better to use unambiguous terms, even if you accept the newer redefinition of “free” to include “gratis”.
If gratis is possible, it would always be the minimum. So what is the difference?
So lets replace “free” with “zero-fee” then.
About the other thing, I can see that “minimum” may seem to imply “zero-fee”, but its not. If we move the free-checkbox below, to apply to all three, this should become clearer.
Normally the minimum fee should be the start of the slider, and there should also be an estimation of how long it takes to confirm, if you just pay the minfee. Then we could remove the “Minimum” radio button. But our smartfee is not that smart by design, so we just have to make the best of it.
We could also remove the “Minimum” radio button, and combine it with “Custom” somehow. Simplest would be to just explain in the tooltip about the minfee.
Yes, adding the minfee as part of the slider could be an idea. On the other hand this would make the slider rather complicated and not fool-proof anymore. One main purpose of smartfee is to just select a fee automatically, so that the transaction confirms, without that the user has to think or understand anything.
So what about making the minfee a checkbox as part of custom. So we would have one simple foolproof “recommended” section, and one complicated “custom” section, where people need to bother reading the tooltips in order to understand the gui.
(I did not address the other nits, this is only about where to put the minfee)
@morcos yes, I agree to what you say, there is a lot of room for improvement. But lets not make more of this pull request than what its supposed to do.
The point is that the current fee/priority selection, selects something thats confirms. And floats. Thats good. Even if way too high in some edge cases, its better than the hardcoded fee/priority values we had before. And people who know better than our smartfee, they can use coin control/custom fee.
Of course its bad, that sophisticated users may end up paying less fee than others in bitcoinland, but I guess there is not much we can do here in regards to the 0.10 release.
update:
Added as separate commit for easier review. Should be squashed before merge. There were less changes to CreateTransaction required than I thought, but I introduced a “-sendfreetransactions” (default=false) command line parameter to have bitcoind behavior compatible.
When this says “to be confirmed within 25 blocks”, what metric is it using for confirmation? The usual 6 blocks? If it’s just 25 blocks to be mined, perhaps “to begin confirmation within 25 blocks” would be better.
It might be desirable to see the Smart-Fee estimate for mining/confirmation time even for Custom fee selection (move it outside the options?).
What does the new “Minimize” button do, since we still have the checkbox under Custom?
Does this under any conditions allow sending with a lower fee than the “minimum”? We still don’t have a mechanism for getting “unstuck” :/
@luke-jr I can change it to “included in a block within 25 blocks”.
Our estimation API is supposed to take a target (like 11 blocks) and returns the fee, not the other way round. Also the estimations are not really good at the moment. As morcos said, even if you just pay the minfee, you get almost always included after 8 blocks. But our estimation code tells you 25 blocks, for a even higher fee. So I’ll leave that for the future, once our estimations are better.
Minimize button minimizes, see initial screenshots, the button is not new.
Its not possible to send a non-sense (like 1 satoshi): 0 < fee < minRelayFee @morcos yes, but txConfirmTarget is set to 25 internally for custom. I think thats fine. So you can choose to send a free transaction for both, recommended and custom.
34 /**
35 * Fees smaller than this (in satoshi) are considered zero fee (for transaction creation)
36 * Override with -mintxfee
37 */
38-CFeeRate CWallet::minTxFee = CFeeRate(10000);
39+CFeeRate CWallet::minTxFee = CFeeRate(1000);