Add sane fallback for fee estimation #7296
pull morcos wants to merge 3 commits into bitcoin:master from morcos:fallbackfee changing 6 files +41 −10-
morcos commented at 5:06 pm on January 5, 2016: memberMake fee estimation logic respect GetRequiredFee at all times. In addition add new commandline option “-fallbackfee” to use when fee estimation does not have sufficient data.
-
MarcoFalke commented at 5:15 pm on January 5, 2016: memberutACK cc99c41
-
Always respect GetRequiredFee for wallet txs 995b9f385b
-
Add sane fallback for fee estimation
Add new commandline option "-fallbackfee" to use when fee estimation does not have sufficient data.
-
in src/wallet/wallet.cpp: in cc99c41ec0 outdated
46@@ -47,6 +47,12 @@ bool fSendFreeTransactions = DEFAULT_SEND_FREE_TRANSACTIONS; 47 * Override with -mintxfee 48 */ 49 CFeeRate CWallet::minTxFee = CFeeRate(DEFAULT_TRANSACTION_MINFEE); 50+/** 51+ * If fee estimation does not have enough data to provide estimates, the use this fee instead.
MarcoFalke commented at 5:15 pm on January 5, 2016:Nit:, then use
…in src/wallet/wallet.cpp: in cc99c41ec0 outdated
2240+ // ... unless we don't have enough mempool data for estimatefee, then use fallbackFee 2241+ if (nFeeNeeded == 0) 2242+ nFeeNeeded = fallbackFee.GetFee(nTxBytes); 2243+ } 2244+ // prevent user from paying a fee below minRelayTxFee or minTxFee 2245+ nFeeNeeded = std::max(nFeeNeeded, GetRequiredFee(nTxBytes));
MarcoFalke commented at 5:16 pm on January 5, 2016:This is important on it’s own. Could you split this diff (line 2236-2237) into a separate commit?
Edit: See 995b9f3
in src/wallet/wallet.h: in cc99c41ec0 outdated
40@@ -41,6 +41,8 @@ static const unsigned int DEFAULT_KEYPOOL_SIZE = 100; 41 static const CAmount DEFAULT_TRANSACTION_FEE = 0; 42 //! -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB 43 static const CAmount nHighTransactionFeeWarning = 0.01 * COIN; 44+//! -fallbackfee default 45+static const CAmount DEFAULT_FALLBACK_FEE = 20000;
MarcoFalke commented at 5:31 pm on January 5, 2016:I’d say11000
is enough, we can determine a “better”DEFAULT_
for 0.13morcos force-pushed on Jan 5, 2016morcos commented at 6:24 pm on January 5, 2016: memberAddressed @MarcoFalke’s comments. Although left fee = 20k satoshis until the bikeshedding is finished. I don’t care want goes there, but I propose using the result of estimatefee(4) with a significantly longer time decay over the last few months. I’ll post the result of that once calculated.
This is meant for 0.12 backport
morcos commented at 9:10 pm on January 5, 2016: member@MarcoFalke ugh.. thanks. more than just that one fail. These are probably things that should be fixed b/c the travis tests that fail are implicitly depending on estimatefee returning minrelaytxfee, which isn’t a good assumption. I’m working on itSQUASHME: Fix rpc tests that assumed fallback to minRelayTxFee bebe58b748laanwj added the label Wallet on Jan 7, 2016laanwj added this to the milestone 0.12.0 on Jan 7, 2016laanwj added the label Needs backport on Jan 7, 2016laanwj commented at 8:04 am on January 7, 2016: memberConcept ACK.
One nit: this adds yet another
-XXXfee
parameter. Although it makes sense, for the wallet we already have-mintxfee
,-paytxfee
,-maxtxfee
this wild growth of options does get a bit confusing for users, I think. But I don’t know a better solution either.btcdrak commented at 2:55 pm on January 8, 2016: contributorConcept ACK will test later today.sdaftuar commented at 3:00 pm on January 12, 2016: memberTested, ACK bebe58b748532157958f9055e4517e280684006cMarcoFalke commented at 4:29 pm on January 12, 2016: member- utACK 995b9f3
- utACK bebe58b
laanwj commented at 10:03 am on January 13, 2016: memberutACKlaanwj merged this on Jan 13, 2016laanwj closed this on Jan 13, 2016
laanwj referenced this in commit c49551886a on Jan 13, 2016laanwj referenced this in commit a36d79bfe2 on Jan 13, 2016laanwj commented at 10:06 am on January 13, 2016: memberCherry-picked to 0.12 as a36d79bfe247e7fc5c6296fd8603f5094edfe558laanwj removed the label Needs backport on Feb 4, 2016furszy referenced this in commit 0724bbbad2 on Jun 28, 2020MarcoFalke locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 06:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me