Skip to content

Conversation

jonasschnelli
Copy link
Contributor

This PR appends a warning at the send coins confirmation text in case the fallback fee was used.

bildschirmfoto 2017-12-13 um 13 13 02

Copy link
Contributor

@promag promag left a 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.

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."));
Copy link
Contributor

Choose a reason for hiding this comment

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

s/estimations/estimation.

Copy link
Contributor

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?

Copy link
Contributor Author

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).

@@ -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);
Copy link
Contributor

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

These should be const?

Copy link
Contributor Author

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.

@@ -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)
Copy link
Contributor

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).

@@ -299,7 +300,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
return AbsurdFee;
}

return SendCoinsReturn(OK);
return SendCoinsReturn(OK, "", (feeCalc.reason == FeeReason::FALLBACK));
Copy link
Contributor

Choose a reason for hiding this comment

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

Drop ()?

@@ -285,7 +286,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
{
if(!fSubtractFeeFromAmount && (total + nFeeRequired) > nBalance)
{
return SendCoinsReturn(AmountWithFeeExceedsBalance);
return SendCoinsReturn(AmountWithFeeExceedsBalance, "", (feeCalc.reason == FeeReason::FALLBACK));
Copy link
Contributor

Choose a reason for hiding this comment

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

Drop ()?

@jonasschnelli jonasschnelli force-pushed the 2017/12/qt_warn_fallbackfee branch from 28a47e7 to 147dc47 Compare December 14, 2017 06:27
@jonasschnelli
Copy link
Contributor Author

Fixed @promag points

@laanwj
Copy link
Member

laanwj commented Dec 14, 2017

Concept ACK.

@morcos
Copy link
Contributor

morcos commented Dec 14, 2017

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.

@jonasschnelli
Copy link
Contributor Author

@morcos see #11882.
My idea was to follow these steps:

  1. Allow to disable fallbackfee (but off by default) (Disable default fallbackfee on mainnet #11882)
  2. Force RBF BIP125 if fallbackfee is active (Disable default fallbackfee on mainnet #11882)
  3. Warn in the GUI if fallbackfee is present (this PR)
  4. Disable fallback fee by default in GUI (upcoming if Disable default fallbackfee on mainnet #11882 gets merged)
  5. Disable fallback fee by default in RPC (upcoming if Disable default fallbackfee on mainnet #11882 gets merged, but later)

@morcos
Copy link
Contributor

morcos commented Dec 15, 2017

@jonasschnelli commented there.
too many options. lets just be more forceful about defaulting to the "right" thing. and if people want something different they have a way of manually doing that.

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.

@jonasschnelli
Copy link
Contributor Author

jonasschnelli commented Dec 15, 2017

@morcos. Yes. Sounds good.
This PR though is completely disconnected from the default value,... lets continue the default value discussion in #11882.

@morcos
Copy link
Contributor

morcos commented Dec 15, 2017

Sure you're right

@maflcko maflcko mentioned this pull request Dec 20, 2017
@thijstriemstra
Copy link

"static fallback transaction fee" does not mean a lot to me (and most people). Can this be rephrased to something human readable?

@maflcko
Copy link
Member

maflcko commented Dec 20, 2017

Is this still needed, since the user explicitly set the fallbackfee (and thus is aware of it)?

I am assuming #11882.

@jonasschnelli
Copy link
Contributor Author

I think as long as a fallback fee is possible, a warning should appear in case such was used.

@thijstriemstra
Copy link

thijstriemstra commented Dec 20, 2017

[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..

@sipa
Copy link
Member

sipa commented Dec 20, 2017

@thijstriemstra Would it help to put the "Please consider waiting a few blocks until fee estimation is ready" first?

@thijstriemstra
Copy link

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!

@laanwj
Copy link
Member

laanwj commented Mar 7, 2018

I think this can be closed now that the fallback fee has been disabled on mainnet (#11882).

@laanwj laanwj closed this Mar 7, 2018
@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.

7 participants