Bitcoin Core  0.20.99
P2P Digital Currency
Functions | Variables
coinselection.cpp File Reference
#include <wallet/coinselection.h>
#include <optional.h>
#include <policy/feerate.h>
#include <util/system.h>
#include <util/moneystr.h>
Include dependency graph for coinselection.cpp:

Go to the source code of this file.

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)
 
static void ApproximateBestSubset (const std::vector< OutputGroup > &groups, const CAmount &nTotalLower, const CAmount &nTargetValue, std::vector< char > &vfBest, CAmount &nBest, int iterations=1000)
 
bool KnapsackSolver (const CAmount &nTargetValue, std::vector< OutputGroup > &groups, std::set< CInputCoin > &setCoinsRet, CAmount &nValueRet)
 

Variables

struct {
descending
 
static const size_t TOTAL_TRIES = 100000
 

Function Documentation

◆ ApproximateBestSubset()

static void ApproximateBestSubset ( const std::vector< OutputGroup > &  groups,
const CAmount nTotalLower,
const CAmount nTargetValue,
std::vector< char > &  vfBest,
CAmount nBest,
int  iterations = 1000 
)
static

Definition at line 173 of file coinselection.cpp.

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

◆ KnapsackSolver()

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

Definition at line 219 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 65 of file coinselection.cpp.

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

Variable Documentation

◆ descending

struct { ... } descending

◆ TOTAL_TRIES

const size_t TOTAL_TRIES = 100000
static

Definition at line 63 of file coinselection.cpp.