aboutsummaryrefslogtreecommitdiff
path: root/src/policy/fees.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 0.18: [wallet] abort when attempting to fund a transaction above maxtxfeeSjors Provoost2019-08-251-1/+0
| | | | | | | FundTransaction calls GetMinimumFee which, when the fee rate is absurdly high, quietly reduced the fee to -maxtxfee. Becaue an absurdly high fee rate is usually the result of a fat finger, aborting seems safer behavior. Github-Pull: #16257 Rebased-From: 806b0052c3b45415862f74f20ba5f389e5b673de
* Add locking annotations to feeStats, shortStats and longStatspracticalswift2018-12-031-0/+1
|
* scripted-diff: Rename from cs_feeEstimator to m_cs_fee_estimatorpracticalswift2018-12-021-8/+8
| | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/cs_feeEstimator/m_cs_fee_estimator/' src/policy/fees.cpp src/policy/fees.h -END VERIFY SCRIPT-
* scripted-diff: Move util files to separate directory.Jim Posen2018-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- mkdir -p src/util git mv src/util.h src/util/system.h git mv src/util.cpp src/util/system.cpp git mv src/utilmemory.h src/util/memory.h git mv src/utilmoneystr.h src/util/moneystr.h git mv src/utilmoneystr.cpp src/util/moneystr.cpp git mv src/utilstrencodings.h src/util/strencodings.h git mv src/utilstrencodings.cpp src/util/strencodings.cpp git mv src/utiltime.h src/util/time.h git mv src/utiltime.cpp src/util/time.cpp sed -i 's/<util\.h>/<util\/system\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmemory\.h>/<util\/memory\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilmoneystr\.h>/<util\/moneystr\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utilstrencodings\.h>/<util\/strencodings\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/<utiltime\.h>/<util\/time\.h>/g' $(git ls-files 'src/*.h' 'src/*.cpp') sed -i 's/BITCOIN_UTIL_H/BITCOIN_UTIL_SYSTEM_H/g' src/util/system.h sed -i 's/BITCOIN_UTILMEMORY_H/BITCOIN_UTIL_MEMORY_H/g' src/util/memory.h sed -i 's/BITCOIN_UTILMONEYSTR_H/BITCOIN_UTIL_MONEYSTR_H/g' src/util/moneystr.h sed -i 's/BITCOIN_UTILSTRENCODINGS_H/BITCOIN_UTIL_STRENCODINGS_H/g' src/util/strencodings.h sed -i 's/BITCOIN_UTILTIME_H/BITCOIN_UTIL_TIME_H/g' src/util/time.h sed -i 's/ util\.\(h\|cpp\)/ util\/system\.\1/g' src/Makefile.am sed -i 's/utilmemory\.\(h\|cpp\)/util\/memory\.\1/g' src/Makefile.am sed -i 's/utilmoneystr\.\(h\|cpp\)/util\/moneystr\.\1/g' src/Makefile.am sed -i 's/utilstrencodings\.\(h\|cpp\)/util\/strencodings\.\1/g' src/Makefile.am sed -i 's/utiltime\.\(h\|cpp\)/util\/time\.\1/g' src/Makefile.am sed -i 's/-> util ->/-> util\/system ->/' test/lint/lint-circular-dependencies.sh sed -i 's/src\/util\.cpp/src\/util\/system\.cpp/g' test/lint/lint-format-strings.py test/lint/lint-locale-dependence.sh sed -i 's/src\/utilmoneystr\.cpp/src\/util\/moneystr\.cpp/g' test/lint/lint-locale-dependence.sh sed -i 's/src\/utilstrencodings\.\(h\|cpp\)/src\/util\/strencodings\.\1/g' test/lint/lint-locale-dependence.sh sed -i 's/src\\utilstrencodings\.cpp/src\\util\\strencodings\.cpp/' build_msvc/libbitcoinconsensus/libbitcoinconsensus.vcxproj -END VERIFY SCRIPT-
* Update copyright headers to 2018DrahtBot2018-07-271-1/+1
|
* fee estimator: avoid sorting mempool on shutdownSuhas Daftuar2018-01-251-6/+7
|
* Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|
* Remove dead feeest-file read code for old versionsMatt Corallo2017-12-191-24/+15
| | | | | | 0.15.0 introduced a new feeest file format, and support for parsing old versions was never fully added. We now simply fail to read the old format, so remove the dead partial-implementation.
* Merge #11273: Ignore old format estimation fileWladimir J. van der Laan2017-12-191-26/+3
|\ | | | | | | | | | | | | | | | | | | | | | | 3a3a9f9 Ignore old format estimation file (Murch) Pull request description: The fee estimation data format changed from 0.14.x to 0.15.0, so we should no longer read the old data. H/T @jnewbery, @morcos Pending testing. Tree-SHA512: c8e3824dbdd8f6730133d5ad20b00995e9a63ab54431158a91e2f4d2aba5763b8aa698bce1fffca2713ba3a162e23d8fcd6e3efb9847b015c2e1e8725398150b
| * Ignore old format estimation fileMurch2017-09-071-26/+3
| |
* | Remove includes in .cpp files for things the corresponding .h file already ↵practicalswift2017-11-161-2/+0
| | | | | | | | included
* | scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* | Use unique_ptr:s for {fee,short,long}Stats (TxConfirmStats)practicalswift2017-11-091-15/+9
| |
* | Avoid division by zero in the case of a corrupt estimates filepracticalswift2017-10-131-0/+4
| |
* | Merge #11133: Document assumptions that are being made to avoid division by zeroWladimir J. van der Laan2017-10-121-0/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 55509f1 Document assumptions that are being made to avoid division by zero (practicalswift) Pull request description: Document assumptions (via `assert(…)`:s) that are being made to avoid division by zero. Rationale: * Make it clear to human reviewers and non-human static analyzers that what might look like potential division by zero cases are written the way they are intentionally (these cases are currently flagged by various static analyzers). Tree-SHA512: bbb67b1370afd8f39bda35f9e3a20f4325f017d94cc1bfac3b0d36c9f34c2d95a9efe11efe44db29fb4aadd25d8276d8f0e03c8806ac64f0d21d821912e13b8e
| * | Document assumptions that are being made to avoid division by zeropracticalswift2017-08-281-0/+1
| |/
* | Force explicit double -> int conversion for CFeeRate constructorMatt Corallo2017-09-111-2/+2
| | | | | | | | | | | | | | This resolves an issue where estimatesmartfee would return 999 sat/byte instead of 1000, due to floating point loss of precision Thanks to sipa for suggesting is_integral.
* | Make float <-> int casts explicit outside of test, qt, CFeeRateMatt Corallo2017-09-111-1/+1
|/
* Fix typo: "conditon" → "condition"practicalswift2017-07-181-3/+3
| | | | Typo introduced in commit 439c4e8ad5871f59d87ae2ab77fe01aa6fe41414.
* Improve api to estimatesmartfeeAlex Morcos2017-07-171-11/+8
| | | | | | Change parameter for conservative estimates to be an estimate_mode string. Change to never return a -1 for failure but to instead omit the feerate and return an error string. Throw JSONRPC error on invalid nblocks parameter.
* Merge #10706: Improve wallet fee logic and fix GUI bugsWladimir J. van der Laan2017-07-171-59/+51
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 11590d3 Properly bound check conf_target in wallet RPC calls (Alex Morcos) fd29d3d Remove checking of mempool min fee from estimateSmartFee. (Alex Morcos) 2fffaa9 Make QT fee displays use GetMinimumFee instead of estimateSmartFee (Alex Morcos) 1983ca6 Use CoinControl to pass custom fee setting from QT. (Alex Morcos) 03ee701 Refactor to use CoinControl in GetMinimumFee and FeeBumper (Alex Morcos) ecd81df Make CoinControl a required argument to CreateTransaction (Alex Morcos) Pull request description: This builds on #10589 (first 5 commits from that PR, last 5 commits are new) The first couple commits refactor to use the CCoinControl class to pass fee calculation parameters around. This allows for fixing the buggy interaction in QT between the global payTxFee which can be modified by the RPC call settxfee or temporarily modified by the QT custom fee settings. Before these changes the GUI could sometimes send a transaction with a recently set payTxFee and not respect the settings displayed in the GUI. After these changes, using the GUI does not involve the global transaction confirm target or payTxFee. The prospective fee displays in the smart fee slider and the coin control dialog are changed to use the fee calculation from GetMinimumFee, this simplifies the code and makes them slightly more correct in edge cases. Maxing the fee calculation with the mempool min fee is move from estimateSmartFee to GetMinimumFee. This fixes a long standing bug, and should be tagged for 0.15 as it is holding up finalizing the estimatesmartfee RPC API before release. Tree-SHA512: 4d36a1bd5934aa62f3806d380fcafbef73e9fe5bdf190fc5259a3e3a13349e5ce796e50e7068c46dc630ccf56d061bce5804f0bfe2e082bb01ca725b63efd4c1
| * Remove checking of mempool min fee from estimateSmartFee.Alex Morcos2017-07-141-59/+51
| | | | | | | | | | | | | | | | | | | | This check has been moved to the wallet logic GetMinimumFee. The rpc call to estimatesmartfee will now no longer return a result maxed with the mempool min fee, but automated fee calculations from the wallet will produce the same result as before and coincontrol and sendcoins dialogs in the GUI will correctly display the right prospective fee. changes to policy/fees.cpp include a big whitespace indentation change.
* | Fix incorrect Doxygen tag (@ince → @since). Make Doxygen parameter names ↵practicalswift2017-07-161-1/+1
| | | | | | | | match actual parameter names.
* | Fix typospracticalswift2017-07-151-2/+2
|/
* Merge #10543: Change API to estimaterawfeeWladimir J. van der Laan2017-07-111-1/+32
|\ | | | | | | | | | | | | | | 5e3b7b5 Improve error reporting for estimaterawfee (Alex Morcos) 1fafd70 Add function to report highest estimate target tracked per horizon (Alex Morcos) 9c85b91 Change API to estimaterawfee (Alex Morcos) Tree-SHA512: e624c6e7967e9e48abe49f5818bd674e5710e571cc093029d2f90d39fdfba3c1f30e83bf89f6dce97052b59a7d9636a64642ccfb26effd149c417d0afbed0c0b
| * Add function to report highest estimate target tracked per horizonAlex Morcos2017-07-101-1/+19
| |
| * Change API to estimaterawfeeAlex Morcos2017-07-101-0/+13
| | | | | | | | Report results for all 3 possible time horizons instead of specifying time horizon as an argument.
* | Add RPC options for RBF, confirmation target, and conservative fee estimation.Alex Morcos2017-07-101-0/+14
|/ | | | Add support for setting each of these attributes on a per RPC call basis to sendtoaddress, sendmany, fundrawtransaction (already had RBF), and bumpfee (already had RBF and conf target).
* Merge #10284: Always log debug information for fee calculation in ↵Wladimir J. van der Laan2017-06-151-22/+68
|\ | | | | | | | | | | | | | | CreateTransaction 1bebfc8 Output Fee Estimation Calculations in CreateTransaction (Alex Morcos) Tree-SHA512: e25a27f7acbbc3a666d5d85da2554c5aaec4c923ee2fdbcfc532c29c6fbdec3c9e0d6ae6044543ecc339e7bd81df09c8d228e0b53a2c5c2dae0f1098c9453272
| * Output Fee Estimation Calculations in CreateTransactionAlex Morcos2017-06-131-22/+68
| |
* | Merge #10521: Limit variable scopePieter Wuille2017-06-091-1/+2
|\ \ | |/ |/| | | | | | | 90593ed92 Limit variable scope (practicalswift) Tree-SHA512: 4719e303688a31aefbe1d239e86b21dd3c2045524e08bd628c6ba0c6c2a97de14d04305b9beafe0b1dcde7229793e6663168953f192e88ed409be5c30fd2a9a9
| * Limit variable scopepracticalswift2017-06-051-1/+2
| |
* | Merge #10422: Fix timestamp in fee estimate debug messageWladimir J. van der Laan2017-06-051-1/+1
|\ \ | |/ |/| | | | | | | 8d4f401 Fix timestamp in fee estimate debug message (Alex Morcos) Tree-SHA512: eb015ddbb9f52f0f84706a16e503d2894dceed4e796979858ca8bdd7f0ec15bf7646ca3f411b06ff099308c91ca498916778e6bd52db00365baaae1d2f4218f2
| * Fix timestamp in fee estimate debug messageAlex Morcos2017-05-181-1/+1
| |
* | Merge #10419: [trivial] Fix three recently introduced typosPieter Wuille2017-05-261-1/+1
|\ \ | | | | | | | | | | | | | | | efc2e3302 [trivial] Fix three recently introduced typos (practicalswift) Tree-SHA512: 99e97f3c1350299dfce9c0c35547d480f25c0b877da311d9120f113afd3089eda31b88b2378e2370f288b0c41bb69cee0fd3abca661cd93d5a56982f90709f91
| * | [trivial] Fix three recently introduced typospracticalswift2017-05-231-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | ``` $ git blame src/policy/fees.cpp | grep becuase 3810e976 (2017-03-07 11:33:44 -0500 789) * checks for 2*target becuase we are taking the max over all time $ git blame src/policy/fees.h | grep successfullly 2d2e1705 (2017-04-12 12:29:03 -0400 54) * representing that a tx was successfullly confirmed in less than or equal to $ git blame src/wallet/feebumper.cpp | grep "hasen't" a3878374 (2017-05-11 09:34:39 +0200 258) // make sure the transaction still has no descendants and hasen't been mined in the meantime ```
* / Use range-based for loops (C++11) when looping over vector elementspracticalswift2017-05-191-2/+2
|/
* Merge #10199: Better fee estimatesPieter Wuille2017-05-171-142/+477
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 38bc1ec Make more json-like output from estimaterawfee (Alex Morcos) 2d2e170 Comments and improved documentation (Alex Morcos) ef589f8 minor cleanup: remove unnecessary variable (Alex Morcos) 3ee76d6 Introduce a scale factor (Alex Morcos) 5f1f0c6 Historical block span (Alex Morcos) aa19b8e Clean up fee estimate debug printing (Alex Morcos) 10f7cbd Track first recorded height (Alex Morcos) 3810e97 Rewrite estimateSmartFee (Alex Morcos) c7447ec Track failures in fee estimation. (Alex Morcos) 4186d3f Expose estimaterawfee (Alex Morcos) 2681153 minor refactor: explicitly track start of new bucket range and don't update curNearBucket on final loop. (Alex Morcos) 1ba43cc Make EstimateMedianVal smarter about small failures. (Alex Morcos) d3e30bc Refactor to update moving average on fly (Alex Morcos) e5007ba Change parameters for fee estimation and estimates on all 3 time horizons. (Alex Morcos) c0a273f Change file format for fee estimates. (Alex Morcos) Tree-SHA512: 186e7508d86a1f351bb656edcd84ee9091f5f2706331eda9ee29da9c8eb5bf67b8c1f2abf6662835560e7f613b1377099054f20767f41ddcdbc89c4f9e78946d
| * Comments and improved documentationAlex Morcos2017-05-101-0/+10
| |
| * minor cleanup: remove unnecessary variableAlex Morcos2017-05-101-2/+1
| |
| * Introduce a scale factorAlex Morcos2017-05-101-27/+34
| | | | | | | | For the per confirmation number tracking of data, introduce a scale factor so that in the longer horizones confirmations are bucketed together at a resolution of the scale. (instead of 1008 individual data points for each fee bucket, have 42 data points each covering 24 different confirmation values.. (1-24), (25-48), etc.. )
| * Historical block spanAlex Morcos2017-05-101-9/+48
| | | | | | | | Store in fee estimate file the block span for which we were tracking estimates, so we know what targets we can successfully evaluate with the data in the file. When restarting use either this historical block span to set valid range of targets until our current span of tracking estimates is just as long.
| * Clean up fee estimate debug printingAlex Morcos2017-05-101-1/+1
| |
| * Track first recorded heightAlex Morcos2017-05-101-1/+6
| | | | | | | | Track the first time we seen txs in a block that we have been tracking in our mempool. Used to evaluate validity of fee estimates for different targets.
| * Rewrite estimateSmartFeeAlex Morcos2017-05-101-6/+83
| | | | | | | | Change the logic of estimateSmartFee to check a 60% threshold at half the target, a 85% threshold at the target and a 95% threshold at double the target. Always check the shortest time horizon possible and ensure that estimates are monotonically decreasing. Add a conservative mode, which makes sure that the 95% threshold is also met at longer time horizons as well.
| * Track failures in fee estimation.Alex Morcos2017-05-101-14/+58
| | | | | | | | | | | | Start tracking transactions which fail to confirm within the target and are then evicted or otherwise leave mempool. Fix slight error in unit test.
| * Expose estimaterawfeeAlex Morcos2017-05-101-11/+86
| | | | | | | | Track information the ranges of fee rates that were used to calculate the fee estimates (the last range of fee rates in which the data points met the threshold and the first to fail) and provide an RPC call to return this information.
| * minor refactor: explicitly track start of new bucket range and don't update ↵Alex Morcos2017-05-101-1/+6
| | | | | | | | curNearBucket on final loop.
| * Make EstimateMedianVal smarter about small failures.Alex Morcos2017-05-101-5/+3
| | | | | | | | Instead of stopping if it encounters a "sufficient" number of transactions which don't meet the threshold for being confirmed within the target, it keeps looking to add more transactions to see if there is a temporary blip in the data. This allows a smaller number of required data points.
| * Refactor to update moving average on flyAlex Morcos2017-05-101-29/+16
| |