aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/feebumper.cpp
AgeCommit message (Collapse)Author
2018-08-08Merge #13780: 0.17: Pre-branch maintenanceWladimir J. van der Laan
3fc20632a3ad30809356a58d2cf0ea4a4ad4cec3 qt: Set BLOCK_CHAIN_SIZE = 220 (DrahtBot) 2b6a2f4a28792f2fe9dc1be843b1ff1ecae35e8a Regenerate manpages (DrahtBot) eb7daf4d600eeb631427c018a984a77a34aca66e Update copyright headers to 2018 (DrahtBot) Pull request description: Some trivial maintenance to avoid having to do it again after the 0.17 branch off. (The scripts to do this are in `./contrib/`) Tree-SHA512: 16b2af45e0351b1c691c5311d48025dc6828079e98c2aa2e600dc5910ee8aa01858ca6c356538150dc46fe14c8819ed8ec8e4ec9a0f682b9950dd41bc50518fa
2018-08-02[wallet] Add wallet name to log messagesPierre Rochard
After multiple wallets became supported, wallet-related log messages became ambiguous as to which wallet they were being emitted by. fixes #11317
2018-07-27Update copyright headers to 2018DrahtBot
2018-05-23Merge #13011: Cache witness hash in CTransactionWladimir J. van der Laan
fac1223a568fa1ad6dd602350598eed278d115e8 Cache witness hash in CTransaction (MarcoFalke) faab55fbb17f2ea5080bf02bc59eeef5ca746f07 Make CMutableTransaction constructor explicit (MarcoFalke) Pull request description: This speeds up: * compactblocks (v2) * ATMP * validation and miner (via `BlockWitnessMerkleRoot`) * sigcache (see also unrelated #13204) * rpc and rest (nice, but irrelevant) This presumably slows down rescan, which uses a `CTransaction` and its `GetHash`, but never uses the `GetWitnessHash`. The slow down is proportional to the number of witness transactions in the rescan window. I.e. early in the chain there should be no measurable slow down. Later in the chain, there should be a slow down, but acceptable given the speedups in the modules mentioned above. Tree-SHA512: 443e86acfcceb5af2163e68840c581d44159af3fd1fce266cab3504b29fcd74c50812b69a00d41582e7e1c5ea292f420ce5e892cdfab691da9c24ed1c44536c7
2018-05-14Add compile time checking for all cs_wallet runtime locking assertionspracticalswift
2018-05-04Make CMutableTransaction constructor explicitMarcoFalke
Silently converting to a CMutableTransaction will drop all caches and should thus be done explicitly
2018-04-23wallet: Make fee settings non-static membersMarcoFalke
2018-03-21feebumper: discard change outputs below discard rateGregory Sanders
2018-03-14Merge #10637: Coin Selection with Murch's algorithmWladimir J. van der Laan
73b5bf2cb Add a test to make sure that negative effective values are filtered (Andrew Chow) 76d2f068a Benchmark BnB in the worst case where it exhausts (Andrew Chow) 6a34ff533 Have SelectCoinsMinConf and SelectCoins use BnB or Knapsack and use it (Andrew Chow) fab04887c Add a GetMinimumFeeRate function which is wrapped by GetMinimumFee (Andrew Chow) cd927ff32 Move original knapsack solver tests to coinselector_tests.cpp (Andrew Chow) fb716f7b2 Move current coin selection algorithm to coinselection.{cpp,h} (Andrew Chow) 4566ab75f Add tests for the Branch and Bound algorithm (Andrew Chow) 4b2716da4 Remove coinselection.h -> wallet.h circular dependency (Andrew Chow) 7d77eb1a5 Use a struct for output eligibility (Andrew Chow) ce7435cf1 Move output eligibility to a separate function (Andrew Chow) 0185939be Implement Branch and Bound coin selection in a new file (Andrew Chow) f84fed8eb Store effective value, fee, and long term fee in CInputCoin (Andrew Chow) 12ec29d3b Calculate and store the number of bytes required to spend an input (Andrew Chow) Pull request description: This is an implementation of the [Branch and Bound coin selection algorithm written by Murch](http://murch.one/wp-content/uploads/2016/11/erhardt2016coinselection.pdf) (@xekyo). I have it set so this algorithm will run first and if it fails, it will fall back to the current coin selection algorithm. The coin selection algorithms and tests have been refactored to separate files instead of having them all in wallet.cpp. I have added some tests for the new algorithm and a test for all of coin selection in general. However, more tests may be needed, but I will need help with coming up with more test cases. This PR uses some code borrowed from #10360 to use effective values when selecting coins. Tree-SHA512: b0500f406bf671e74984fae78e2d0fbc5e321ddf4f06182c5855e9d1984c4ef2764c7586d03e16fa4b578c340b21710324926f9ca472d5447a0d1ed43eb4357e
2018-03-09Calculate and store the number of bytes required to spend an inputAndrew Chow
2018-03-07[wallet] Construct CWalletTx objects in CommitTransactionRussell Yanofsky
Construct CWalletTx objects in CWallet::CommitTransaction, instead of having callers do it. This ensures CWalletTx objects are constructed in a uniform way and all fields are set. This also makes it possible to avoid confusing and wasteful CWalletTx copies in https://github.com/bitcoin/bitcoin/pull/9381 There is no change in behavior.
2018-02-15Merge #12356: Fix 'mempool min fee not met' debug outputWladimir J. van der Laan
bb00c95 Consistently use FormatStateMessage in RPC error output (Ben Woosley) 8b8a1c4 Add test for 'mempool min fee not met' rpc error (Ben Woosley) c04e0f6 Fix 'mempool min fee not met' debug output (Ben Woosley) Pull request description: Output the value that is tested, rather than the unmodified fee value. Prompted by looking into: #11955 Tree-SHA512: fc0bad47d4af375d208f657a6ccbad6ef7f4e2989ae2ce1171226c22fa92847494a2c55cca687bd5a1548663ed3313569bcc31c00d53c0c193a1b865dd8a7657
2018-02-08Consistently use FormatStateMessage in RPC error outputBen Woosley
This will include the error code and debug output as well as the reason string. See #11955 for the motivation.
2018-01-29feebumper: Use PreconditionChecks to determine bump eligibilityMarcoFalke
2018-01-23move more bumpfee prechecks to feebumper::PreconditionChecksGregory Sanders
2017-11-16scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider
-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-
2017-11-10[wallet] Change feebumper from class to functionsRussell Yanofsky
Change feebumper from a stateful class into a namespace of stateless functions. Having the results of feebumper calls persist in an object makes process separation between Qt and wallet awkward, because it means the feebumper object either has to be serialized back and forth between Qt and wallet processes between fee bump calls, or that the feebumper object needs to stay alive in the wallet process with an object reference passed back to Qt. It's simpler just to have fee bumper calls return their results immediately instead of storing them in an object with an extended lifetime. In addition to making feebumper stateless, also: - Move LOCK calls from Qt code to feebumper - Move TransactionCanBeBumped implementation from Qt code to feebumper
2017-11-10[refactor] Make feebumper namespaceRussell Yanofsky
Future commit will remove the FeeBumper class. This commit simply places everything into a feebumper namespace, and changes the enum class name from BumpeFeeResult to feebumper::Result.
2017-11-10[trivial] Rename feebumper variables according to project code styleRussell Yanofsky
Future PRs will completely refactor this translation unit and touch all this code so we rename the variables to follow project stlye guidelines in this preparation commit. Don't use m_ prefixes for member variables since we're going to remove the class entirely in the next commits.
2017-11-09Merge #10368: [wallet] Remove helper conversion operator from walletWladimir J. van der Laan
5a5e4e9 [wallet] Remove CTransaction&() helper conversion operator from wallet implementation. (Karl-Johan Alm) Pull request description: The `CTransaction&()` operator in `CMerkleTx` makes conversion into `CTransaction`s transparent, but was marked as to-be-removed in favor of explicitly getting the `tx` ivar, presumably as the operator can lead to ambiguous behavior and makes the code harder to follow. This PR removes the operator and adapts callers. This includes some cases of `static_cast<CTransaction>(wtx)` → `*wtx.tx`, which is definitely an improvement. Tree-SHA512: 95856fec7194d6a79615ea1c322abfcd6bcedf6ffd0cfa89bbdd332ce13035fa52dd4b828d20df673072dde1be64b79c513529a6f422dd5f0961ce722a32d56a
2017-11-03[trivial] Fix error messages in CFeeBumperKarl-Johan Alm
2017-08-25Merge #10976: [MOVEONLY] Move some static functions out of wallet.h/cppWladimir J. van der Laan
f01103c MOVEONLY: Init functions wallet/wallet.cpp -> wallet/init.cpp (Russell Yanofsky) e7fe320 MOVEONLY: Fee functions wallet/wallet.cpp -> wallet/fees.cpp (Russell Yanofsky) d97fe20 Move some static functions out of wallet.h/cpp (Russell Yanofsky) Pull request description: This just moves some static wallet fee and init functions out of `wallet/wallet.cpp` and into new `wallet/fees.cpp` and `wallet/init.cpp` source files. There is one commit updating declarations and callers, followed by two MOVEONLY commits actually moving the function bodies. This change is desirable because wallet.h/cpp are monolithic and hard to navigate, so pulling things out and grouping together pieces of related functionality should improve the organization. Another motivation is the wallet process separation work in https://github.com/bitcoin/bitcoin/pull/10973, where (at least initially) parameter parsing and fee estimation are still done in the main process rather than the wallet process, and having functions that run in different processes scrambled up throughout wallet.cpp is unnecessarily confusing. Tree-SHA512: 6e6982ff82b2ab4e681c043907e2b1801ceb9513394730070f16c46ad338278a863f5b3759aa13db76a259b268b1c919c81f4e339f0796a3cfb990161e8c316d
2017-08-18Merge #11039: Avoid second mapWallet lookupWladimir J. van der Laan
8f2f1e0 wallet: Avoid second mapWallet lookup (João Barbosa) Pull request description: All calls to `mapWallet.count()` have the intent to detect if a `txid` exists and most are followed by a second lookup to retrieve the `CWalletTx`. This PR replaces all `mapWallet.count()` calls with `mapWallet.find()` to avoid the second lookup. Tree-SHA512: 96b7de7f5520ebf789a1aec1949a4e9c74e13683869cee012f717e5be8e51097d068e2347a36e89097c9a89f1ed1a1529db71760dac9b572e36a3e9ac1155f29
2017-08-14wallet: Avoid second mapWallet lookupJoão Barbosa
2017-08-14Move some static functions out of wallet.h/cppRussell Yanofsky
This commit just moves a few function declarations and updates callers. Function bodies are moved in two followup MOVEONLY commits. This change is desirable because wallet.h/cpp are monolithic and hard to navigate, so pulling things out and grouping together pieces of related functionality should improve the organization. Another proximate motivation is the wallet process separation work in https://github.com/bitcoin/bitcoin/pull/10973, where (at least initially) parameter parsing and fee estimation are still done in the main process rather than the wallet process, and having functions that run in different processes scrambled up throughout wallet.cpp is unnecessarily confusing.
2017-08-14scripted-diff: stop using the gArgs wrappersMarko Bencun
They were temporary additions to ease the transition. -BEGIN VERIFY SCRIPT- find src/ -name "*.cpp" ! -wholename "src/util.h" ! -wholename "src/util.cpp" | xargs perl -i -pe 's/(?<!\.)(ParseParameters|ReadConfigFile|IsArgSet|(Soft|Force)?(Get|Set)(|Bool|)Arg(s)?)\(/gArgs.\1(/g' -END VERIFY SCRIPT-
2017-07-14Refactor to use CoinControl in GetMinimumFee and FeeBumperAlex Morcos
Improve parameter precedence in coin_control
2017-07-10Add RPC options for RBF, confirmation target, and conservative fee estimation.Alex Morcos
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).
2017-07-06Change default fee estimation mode.Alex Morcos
Fee estimates will default to be non-conservative if the transaction in question is opt-in-RBF.
2017-07-06Introduce a fee estimate mode.Alex Morcos
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.
2017-06-13Output Fee Estimation Calculations in CreateTransactionAlex Morcos
2017-06-05Merge #10455: Simplify feebumper minimum fee code slightlyWladimir J. van der Laan
88b8f0b Simplify feebumper minimum fee code slightly (Russell Yanofsky) Tree-SHA512: 4465daef63936860d016a7fd7fd31ce62878d87cb943a90f321b07a40accdc5e7970d99de46b2bc924eb0b422144d6f01649855949395518790ecd05d300ee52
2017-05-25Simplify feebumper minimum fee code slightlyRussell Yanofsky
No change in behavior. Get rid of specifiedConfirmTarget if/else block and rename specifiedConfirmTarget and ignoreUserSetFee variables to ignoreGlobalPayTxFee.
2017-05-23[trivial] Fix three recently introduced typospracticalswift
``` $ 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 ```
2017-05-11Make sure we re-check the conditions of a feebump during commitJonas Schnelli
2017-05-09[wallet] Remove CTransaction&() helper conversion operator from wallet ↵Karl-Johan Alm
implementation.
2017-05-03Consensus: Minimal way to move dust out of consensusJorge Timón
2017-04-26cleanup: reduce to one GetMinimumFee call signatureAlex Morcos
2017-04-20Merge #9942: Refactor CBlockPolicyEstimatorWladimir J. van der Laan
68af651 MOVEONLY: move TxConfirmStats to cpp (Alex Morcos) 2332f19 Initialize TxConfirmStats in constructor (Alex Morcos) 5ba81e5 Read and Write fee estimate file directly from CBlockPolicyEstimator (Alex Morcos) 14e10aa Call estimate(Smart)Fee directly from CBlockPolicyEstimator (Alex Morcos) dbb9e36 Give CBlockPolicyEstimator it's own lock (Alex Morcos) f6187d6 Make processBlockTx private. (Alex Morcos) ae7327b Make feeEstimator its own global instance of CBlockPolicyEstimator (Alex Morcos) Tree-SHA512: dbf3bd2b30822e609a35f3da519b62d23f8a50e564750695ddebd08553b4c01874ae3e07d792c6cc78cc377d2db33b951ffedc46ac7edaf5793f9ebb931713af
2017-04-13[Wallet] Decouple CInputCoin from CWalletTxNicolasDorier
2017-04-10Call estimate(Smart)Fee directly from CBlockPolicyEstimatorAlex Morcos
2017-04-08[Wallet] Rename std::pair<const CWalletTx*, unsigned int> to CInputCoinNicolasDorier
2017-04-02Improve CFeeBumper interface, add comments, make use of std::moveJonas Schnelli
2017-04-02Cancel feebump is vErrors is not emptyJonas Schnelli
2017-04-02Use static calls for GetRequiredFee and GetMinimumFee, remove make_pair from ↵Jonas Schnelli
emplace_back
2017-04-02Restore CalculateMaximumSignedTxSize function signatureJonas Schnelli
2017-04-02Directly abort execution in FeeBumper::commit if wallet or tx is not availableJonas Schnelli
2017-04-02Refactor Bumpfee core functionalityJonas Schnelli