Bitcoin Core  22.99.0
P2P Digital Currency
Classes | Namespaces | Functions | Variables
coinselection.h File Reference
#include <consensus/amount.h>
#include <policy/feerate.h>
#include <primitives/transaction.h>
#include <random.h>
#include <optional>
Include dependency graph for coinselection.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  wallet::CInputCoin
 A UTXO under consideration for use in funding a new transaction. More...
 
struct  wallet::CoinSelectionParams
 Parameters for one iteration of Coin Selection. More...
 
struct  wallet::CoinEligibilityFilter
 Parameters for filtering which OutputGroups we may use in coin selection. More...
 
struct  wallet::OutputGroup
 A group of UTXOs paid to the same output script. More...
 
struct  wallet::SelectionResult
 

Namespaces

 wallet
 

Functions

CAmount wallet::GetSelectionWaste (const std::set< CInputCoin > &inputs, CAmount change_cost, CAmount target, bool use_effective_value=true)
 Compute the waste for this result given the cost of change and the opportunity cost of spending these inputs now vs in the future. More...
 
std::optional< SelectionResult > wallet::SelectCoinsBnB (std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target, const CAmount &cost_of_change)
 
std::optional< SelectionResult > wallet::SelectCoinsSRD (const std::vector< OutputGroup > &utxo_pool, CAmount target_value)
 Select coins by Single Random Draw. More...
 
std::optional< SelectionResult > wallet::KnapsackSolver (std::vector< OutputGroup > &groups, const CAmount &nTargetValue)
 

Variables

static constexpr CAmount wallet::MIN_CHANGE {COIN / 100}
 target minimum change amount More...
 
static const CAmount wallet::MIN_FINAL_CHANGE = MIN_CHANGE/2
 final minimum change amount after paying for fees More...