-
Notifications
You must be signed in to change notification settings - Fork 37.8k
[Qt] Warn if fallback fee has been used #11892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Qt] Warn if fallback fee has been used #11892
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK 28a47e7. Some nits though.
src/qt/sendcoinsdialog.cpp
Outdated
if (prepareStatus.m_fallback_fee_used) { | ||
questionString.append("<hr /><span style='color:#aa0000;'>"); | ||
questionString.append(tr("WARNING")+":</span> <span>"); | ||
questionString.append(tr("A static fallback transaction fee has been used due to missing fee estimations. Please consider waiting a few blocks until fee estimation is ready. Your transaction will very likely get stuck or you overpay in fees.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/estimations/estimation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would reorder the sentenses: 1, 2, 3 -> 3, 1, 2. Also, avoid you/your?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the order is correct (cause, fix, possible issue).
src/wallet/wallet.h
Outdated
@@ -961,7 +961,7 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface | |||
* @note passing nChangePosInOut as -1 will result in setting a random position | |||
*/ | |||
bool CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, int& nChangePosInOut, | |||
std::string& strFailReason, const CCoinControl& coin_control, bool sign = true); | |||
std::string& strFailReason, const CCoinControl& coin_control, FeeCalculation& feeCalc, bool sign = true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fee_calc? This line already uses new convention. Same for others.
{ | ||
} | ||
StatusCode status; | ||
QString reasonCommitFailed; | ||
bool m_fallback_fee_used; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I keep it non const for now to avoid changing code that receives that struct, also, other variables are also non-const.
src/qt/walletmodel.h
Outdated
@@ -144,13 +144,15 @@ class WalletModel : public QObject | |||
// Return status record for SendCoins, contains error id + information | |||
struct SendCoinsReturn | |||
{ | |||
SendCoinsReturn(StatusCode _status = OK, QString _reasonCommitFailed = "") | |||
SendCoinsReturn(StatusCode _status = OK, QString _reasonCommitFailed = "", bool _m_fallback_fee_used = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop _m_
prefix? , bool fallback_fee_used = false)
.
src/qt/walletmodel.cpp
Outdated
@@ -299,7 +300,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact | |||
return AbsurdFee; | |||
} | |||
|
|||
return SendCoinsReturn(OK); | |||
return SendCoinsReturn(OK, "", (feeCalc.reason == FeeReason::FALLBACK)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop ()
?
src/qt/walletmodel.cpp
Outdated
@@ -285,7 +286,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact | |||
{ | |||
if(!fSubtractFeeFromAmount && (total + nFeeRequired) > nBalance) | |||
{ | |||
return SendCoinsReturn(AmountWithFeeExceedsBalance); | |||
return SendCoinsReturn(AmountWithFeeExceedsBalance, "", (feeCalc.reason == FeeReason::FALLBACK)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop ()
?
28a47e7
to
147dc47
Compare
Fixed @promag points |
Concept ACK. |
Another option for the GUI would be to just prevent using a fallback fee at all. We already have the option to manually set the fee. We could instead refuse to send the transaction unless the user manually sets the fee. I think I would prefer that approach. Actually it might not be terrible to do a similar thing for RPC. Where any sendto call fails if fee estimation is needed and doesn't work with an error message telling you you must specify the fee (hopefully the option to specify the fee exists for all RPC sending calls). But at the very least we could do it for QT. |
@morcos see #11882.
|
@jonasschnelli commented there. EDIT. And I think the release notes and help could say that if you are setting a fallbackfee it is highly recommend, but not required that you set walletrbf=1, but adding two more config options seems overkill. |
Sure you're right |
"static fallback transaction fee" does not mean a lot to me (and most people). Can this be rephrased to something human readable? |
Is this still needed, since the user explicitly set the fallbackfee (and thus is aware of it)? I am assuming #11882. |
I think as long as a fallback fee is possible, a warning should appear in case such was used. |
[I don't want to block progress on any PRs but] I'd have to google this 'static fallback transaction fee' and doublecheck before i'd feel happy to make the transaction after reading such a warning.. |
@thijstriemstra Would it help to put the "Please consider waiting a few blocks until fee estimation is ready" first? |
In a way, but 'a few', can we be more specific? or less detailed? :) as long as cryptic statements like 'static fallback' are avoided I think. Thanks for the feedback! |
I think this can be closed now that the fallback fee has been disabled on mainnet (#11882). |
This PR appends a warning at the send coins confirmation text in case the fallback fee was used.