19 return a.effective_value >
b.effective_value;
218 int iterations = 1000) {
231 for (
size_t i = 0; i <
groups.size(); i++) {
329 "SelectCoins() best subset: ");
static constexpr Amount MAX_MONEY
No amount larger than this (in satoshi) is valid.
Amount GetFee(size_t nBytes) const
Return the fee in satoshis for the given size in bytes.
bool randbool() noexcept
Generate a random boolean.
static void ApproximateBestSubset(const std::vector< OutputGroup > &groups, const Amount &nTotalLower, const Amount &nTargetValue, std::vector< char > &vfBest, Amount &nBest, int iterations=1000)
static const size_t TOTAL_TRIES
bool KnapsackSolver(const Amount nTargetValue, std::vector< OutputGroup > &groups, std::set< CInputCoin > &setCoinsRet, Amount &nValueRet)
bool SelectCoinsBnB(std::vector< OutputGroup > &utxo_pool, const Amount &target_value, const Amount &cost_of_change, std::set< CInputCoin > &out_set, Amount &value_ret, const Amount not_input_fees)
This is the Branch and Bound Coin Selection algorithm designed by Murch.
static constexpr Amount MIN_CHANGE
target minimum change amount
static bool LogAcceptCategory(BCLog::LogFlags category)
Return true if log accepts specified category.
#define LogPrint(category,...)
#define LogPrintToBeContinued
std::string FormatMoney(const Amount amt)
Do not use these functions to represent or parse monetary amounts to or from JSON but use AmountFromV...
void insert(Tdst &dst, const Tsrc &src)
Simplification of std insertion.
void Shuffle(I first, I last, R &&rng)
More efficient than using std::shuffle on a FastRandomContext.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
static constexpr Amount zero() noexcept
std::vector< CInputCoin > m_outputs
CFeeRate m_long_term_feerate
CFeeRate m_effective_feerate
void Insert(const CInputCoin &output, int depth, bool from_me, bool positive_only)
bool EligibleForSpending(const CoinEligibilityFilter &eligibility_filter) const