Bitcoin Core  27.99.0
P2P Digital Currency
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
coinselection.h File Reference
#include <consensus/amount.h>
#include <consensus/consensus.h>
#include <outputtype.h>
#include <policy/feerate.h>
#include <primitives/transaction.h>
#include <random.h>
#include <util/check.h>
#include <util/insert.h>
#include <util/result.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

struct  wallet::COutput
 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::Groups
 
struct  wallet::OutputGroupTypeMap
 Stores several 'Groups' whose were mapped by output type. More...
 
struct  wallet::SelectionResult
 

Namespaces

 wallet
 

Typedefs

typedef std::map< CoinEligibilityFilter, OutputGroupTypeMap > wallet::FilteredOutputGroups
 

Enumerations

enum class  wallet::SelectionAlgorithm : uint8_t {
  wallet::BNB = 0 , wallet::KNAPSACK = 1 , wallet::SRD = 2 , wallet::CG = 3 ,
  wallet::MANUAL = 4
}
 

Functions

CAmount wallet::GenerateChangeTarget (const CAmount payment_value, const CAmount change_fee, FastRandomContext &rng)
 Choose a random change target for each transaction to make it harder to fingerprint the Core wallet based on the change output values of transactions it creates. More...
 
std::string wallet::GetAlgorithmName (const SelectionAlgorithm algo)
 
util::Result< SelectionResult > wallet::SelectCoinsBnB (std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target, const CAmount &cost_of_change, int max_weight)
 
util::Result< SelectionResult > wallet::CoinGrinder (std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target, CAmount change_target, int max_weight)
 
util::Result< SelectionResult > wallet::SelectCoinsSRD (const std::vector< OutputGroup > &utxo_pool, CAmount target_value, CAmount change_fee, FastRandomContext &rng, int max_weight)
 Select coins by Single Random Draw. More...
 
util::Result< SelectionResult > wallet::KnapsackSolver (std::vector< OutputGroup > &groups, const CAmount &nTargetValue, CAmount change_target, FastRandomContext &rng, int max_weight)
 

Variables

static constexpr CAmount wallet::CHANGE_LOWER {50000}
 lower bound for randomly-chosen target change amount More...
 
static constexpr CAmount wallet::CHANGE_UPPER {1000000}
 upper bound for randomly-chosen target change amount More...