Bitcoin Core  0.20.99
P2P Digital Currency
Classes | Functions | Variables
coinselection.h File Reference
#include <amount.h>
#include <primitives/transaction.h>
#include <random.h>
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  CInputCoin
 
struct  CoinEligibilityFilter
 
struct  OutputGroup
 

Functions

bool SelectCoinsBnB (std::vector< OutputGroup > &utxo_pool, const CAmount &target_value, const CAmount &cost_of_change, std::set< CInputCoin > &out_set, CAmount &value_ret, CAmount not_input_fees)
 
bool KnapsackSolver (const CAmount &nTargetValue, std::vector< OutputGroup > &groups, std::set< CInputCoin > &setCoinsRet, CAmount &nValueRet)
 

Variables

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

Function Documentation

◆ KnapsackSolver()

bool KnapsackSolver ( const CAmount nTargetValue,
std::vector< OutputGroup > &  groups,
std::set< CInputCoin > &  setCoinsRet,
CAmount nValueRet 
)

Definition at line 218 of file coinselection.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SelectCoinsBnB()

bool SelectCoinsBnB ( std::vector< OutputGroup > &  utxo_pool,
const CAmount target_value,
const CAmount cost_of_change,
std::set< CInputCoin > &  out_set,
CAmount value_ret,
CAmount  not_input_fees 
)

Definition at line 64 of file coinselection.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ MIN_CHANGE

constexpr CAmount MIN_CHANGE {COIN / 100}
static

target minimum change amount

Definition at line 13 of file coinselection.h.

◆ MIN_FINAL_CHANGE

const CAmount MIN_FINAL_CHANGE = MIN_CHANGE/2
static

final minimum change amount after paying for fees

Definition at line 15 of file coinselection.h.