Skip to content

Conversation

@morcos
Copy link
Contributor

@morcos morcos commented Jun 14, 2017

This PR takes advantage of the new fee estimation feature that will potentially give lower estimates if recent market conditions warrant it. The logic used here is that any time a transaction signals opt-in-RBF and uses automatic fee estimation then it will use the non-conservative estimate. Transactions which do not signal opt-in-RBF will still use the default conservative estimate.

In a nutshell conservative estimates require that your fee rate would meet the necessary confirmation threshold for double your target at longer time horizons as well. This reduces the likelihood that you place a transaction just as the market is starting to get busy again that ends up being stuck for a very long time.

I'm working on a follow-on PR which will allow the specification of transaction confirmation target and whether the estimate should be conservative or not on a per-RPC call basis for sendtoaddress, sendmany, and fundrawtransaction.

I'd love it if someone else working on the QT ability to force estimates to be conservative or not (overriding the RBF implied default).

The first commit is #10582 which is a pre-existing bug fix

morcos added 4 commits June 18, 2017 06:49
GetMinimumFee now passes the conservative argument into estimateSmartFee.
Call CalculateEstimateType(mode) before calling GetMinimumFee or estimateSmartFee to determine the value of this argument.
CCoinControl can now be used to control this mode.
Fee estimates will default to be non-conservative if the transaction in question is opt-in-RBF.
@morcos morcos force-pushed the aggressiveEstimates branch from 029282f to 2c0d546 Compare June 18, 2017 12:14
@morcos
Copy link
Contributor Author

morcos commented Jun 18, 2017

Rebased due to conflict with #10422

@laanwj
Copy link
Member

laanwj commented Jun 22, 2017

Nice!

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.

I really have no ability to review the Qt changes here, but generally looks awesome.

return ::AcceptToMemoryPool(mempool, state, tx, true, NULL, NULL, false, nAbsurdFee);
}

bool CalculateEstimateType(FeeEstimateMode mode, bool opt_in_rbf) {
Copy link
Contributor

Choose a reason for hiding this comment

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

A more descriptive name here may be useful - ShouldEstimateBeConservative or something?

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 it makes more sense to let it be generic and ideally estimatesmartfee would take a FeeEstimateMode and this functions purpose would be to take any requested mode and other wallet parameters and use wallet logic to determine a final mode. Rather than make all those changes now while not yet needed though, I think I'll just change the RPC interface to conservative estimates to take a string as per #10589 (review)

@morcos
Copy link
Contributor Author

morcos commented Jun 27, 2017

Closing this since it's contained in #10589.

@morcos morcos closed this Jun 27, 2017
@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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants