aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/coinselection.h
AgeCommit message (Collapse)Author
2021-04-30rpc: include_unsafe option for fundrawtransactiont-bast
Allow RPC users to opt-in to unsafe inputs when funding a raw transaction. Applications that need to manage a complex RBF flow (such as lightning nodes using anchor outputs) are very limited if they can only use safe inputs. Fixes #21299
2021-04-26[docs] add doxygen comments to wallet codeglozow
Co-authored-by: Xekyo <murch@murch.one>
2021-02-01Merge #20040: wallet: Refactor OutputGroups to handle fees and spending ↵Samuel Dobson
eligibility on grouping 5d4597666d589e39354e0d8dd5b2afbe1a5d7d8e Rewrite OutputGroups to be clearer and to use scriptPubKeys (Andrew Chow) f6b305273910db0e46798d361413a7e878cb45f7 Explicitly filter out partial groups when we don't want them (Andrew Chow) 416d74fb1687ae1d47a58c153d09d9afe0b6dc60 Move OutputGroup positive only filtering into Insert (Andrew Chow) d895e98b594b873f3d34c8ba63e9b55125d51b5a Move EligibleForSpending into GroupOutputs (Andrew Chow) 99b399aba5d27476b61b4865cc39553d03965d57 Move fee setting of OutputGroup to Insert (Andrew Chow) 6148a8acda5e594bb9b3b2d989056f9e03ddbdbd Move GroupOutputs into SelectCoinsMinConf (Andrew Chow) 2acad036575ec998f8bbe4f10f6206b1c8ad3d23 Remove OutputGroup non-default constructors (Andrew Chow) Pull request description: Even after #17458, we still deal with setting fees of an `OutputGroup` and filtering the `OutputGroup` outside of the struct. We currently make all of the `OutputGroup`s in `SelectCoins` and then copy and modify them within each `SelectCoinsMinConf` scenario. This PR changes this to constructing the `OutputGroup`s within the `SelectCoinsMinConf` so that the scenario can be taken into account during the group construction. Furthermore, setting of fees and filtering for effective value is moved into `OutputGroup::Insert` itself so that we don't add undesirable outputs to an `OutputGroup` rather than deleting them afterwards. To facilitate fee calculation and effective value filtering during `OutputGroup::Insert`, `OutputGroup` now takes the feerates in its constructor and computes the fees and effective value for each output during `Insert`. While removing `OutputGroup`s in accordance with the `CoinEligibilityFilter` still requires creating the `OutputGroup`s first, we can do that within the function that makes them - `GroupOutput`s. ACKs for top commit: Xekyo: Code review ACK: https://github.com/bitcoin/bitcoin/pull/20040/commits/5d4597666d589e39354e0d8dd5b2afbe1a5d7d8e fjahr: Code review ACK 5d4597666d589e39354e0d8dd5b2afbe1a5d7d8e meshcollider: Light utACK 5d4597666d589e39354e0d8dd5b2afbe1a5d7d8e Tree-SHA512: 35965b6d49a87f4ebb366ec4f00aafaaf78e9282481ae2c9682b515a3a9f2cbcd3cd6e202fee29489d48fe7f3a7cede4270796f5e72bbaff76da647138fb3059
2020-12-31scripted-diff: Bump copyright headersMarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-
2020-10-02Explicitly filter out partial groups when we don't want themAndrew Chow
Instead of hacking OutputGroup::m_ancestors to discourage the inclusion of partial groups via the eligibility filter, add a parameter to the eligibility filter that indicates whether we want to include the group. Then for those partial groups, don't return them in GroupOutputs if we indicate they aren't desired.
2020-10-02Move OutputGroup positive only filtering into InsertAndrew Chow
2020-09-29Move fee setting of OutputGroup to InsertAndrew Chow
OutputGroup will handle the fee and effective value computations inside of Insert. It now needs to take the effective feerate and long term feerates as arguments to its constructor.
2020-09-29Remove OutputGroup non-default constructorsAndrew Chow
2020-08-11Refactor OutputGroups to handle effective values, fees, and filteringAndrew Chow
Instead of having callers set the fees, effective values, and filtering of outputs, do these within OutputGroups themselves as member functions. m_fee and m_long_term_fee is added to OutputGroup to track the fees of the OutputGroup.
2018-09-17amount: Move CAmount CENT to unit test headerMarcoFalke
2018-07-27Update copyright headers to 2018DrahtBot
2018-07-24clean-up: Remove no longer used ivars from CInputCoinKarl-Johan Alm
2018-07-24wallet: Switch to using output groups instead of coins in coin selectionKarl-Johan Alm
2018-07-24wallet: Add output groupingKarl-Johan Alm
2018-07-24wallet: Add input bytes to CInputCoinKarl-Johan Alm
With nInputBytes, coin selection can execute without a reference to the COutput
2018-07-24moveonly: CoinElegibilityFilter into coinselection.hKarl-Johan Alm
2018-03-22Fix missing or inconsistent include guardspracticalswift
2018-03-13Move current coin selection algorithm to coinselection.{cpp,h}Andrew Chow
Moves the current coin selection algorithm out of SelectCoinsMinConf and puts it in coinselection.{cpp,h}. The new function, KnapsackSolver, instead of taking a vector of COutputs, will take a vector of CInputCoins that is prepared by SelectCoinsMinConf.
2018-03-13Remove coinselection.h -> wallet.h circular dependencyAndrew Chow
Changes CInputCoin to coinselection and to use CTransactionRef in order to avoid a circular dependency. Also moves other coin selection specific variables out of wallet.h to coinselectoin.h
2018-03-13Implement Branch and Bound coin selection in a new fileAndrew Chow
Create a new file for coin selection logic and implement the BnB algorithm in it.