 |
Bitcoin Core
21.99.0
P2P Digital Currency
|
Go to the documentation of this file.
5 #ifndef BITCOIN_WALLET_COINSELECTION_H
6 #define BITCOIN_WALLET_COINSELECTION_H
23 throw std::invalid_argument(
"tx should not be null");
24 if (i >= tx->vout.size())
25 throw std::out_of_range(
"The output index is out of range");
92 void Insert(
const CInputCoin& output,
int depth,
bool from_me,
size_t ancestors,
size_t descendants,
bool positive_only);
99 bool KnapsackSolver(
const CAmount& nTargetValue, std::vector<OutputGroup>& groups, std::set<CInputCoin>& setCoinsRet,
CAmount& nValueRet);
101 #endif // BITCOIN_WALLET_COINSELECTION_H
void Insert(const CInputCoin &output, int depth, bool from_me, size_t ancestors, size_t descendants, bool positive_only)
OutputGroup(const CFeeRate &effective_feerate, const CFeeRate &long_term_feerate)
const uint64_t max_descendants
static constexpr CAmount MIN_CHANGE
target minimum change amount
const bool m_include_partial_groups
CoinEligibilityFilter(int conf_mine, int conf_theirs, uint64_t max_ancestors)
Include partial destination groups when avoid_reuse and there are full groups.
CFeeRate m_long_term_feerate
const uint64_t max_ancestors
CoinEligibilityFilter(int conf_mine, int conf_theirs, uint64_t max_ancestors, uint64_t max_descendants)
std::shared_ptr< const CTransaction > CTransactionRef
std::vector< CInputCoin > m_outputs
Fee rate in satoshis per kilobyte: CAmount / kB.
CFeeRate m_effective_feerate
An output of a transaction.
static const CAmount MIN_FINAL_CHANGE
final minimum change amount after paying for fees
int64_t CAmount
Amount in satoshis (Can be negative)
CoinEligibilityFilter(int conf_mine, int conf_theirs, uint64_t max_ancestors, uint64_t max_descendants, bool include_partial)
static const CAmount COIN
An outpoint - a combination of a transaction hash and an index n into its vout.
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)
bool EligibleForSpending(const CoinEligibilityFilter &eligibility_filter) const