Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/coinselection.cpp
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
* outputs and fixed size overhead (version, locktime, marker and flag) | * outputs and fixed size overhead (version, locktime, marker and flag) | ||||
*/ | */ | ||||
static const size_t TOTAL_TRIES = 100000; | static const size_t TOTAL_TRIES = 100000; | ||||
bool SelectCoinsBnB(std::vector<CInputCoin> &utxo_pool, | bool SelectCoinsBnB(std::vector<CInputCoin> &utxo_pool, | ||||
const Amount &target_value, const Amount &cost_of_change, | const Amount &target_value, const Amount &cost_of_change, | ||||
std::set<CInputCoin> &out_set, Amount &value_ret, | std::set<CInputCoin> &out_set, Amount &value_ret, | ||||
Amount not_input_fees) { | const Amount not_input_fees) { | ||||
out_set.clear(); | out_set.clear(); | ||||
Amount curr_value = Amount::zero(); | Amount curr_value = Amount::zero(); | ||||
// select the utxo at this index | // select the utxo at this index | ||||
std::vector<bool> curr_selection; | std::vector<bool> curr_selection; | ||||
curr_selection.reserve(utxo_pool.size()); | curr_selection.reserve(utxo_pool.size()); | ||||
Amount actual_target = not_input_fees + target_value; | Amount actual_target = not_input_fees + target_value; | ||||
▲ Show 20 Lines • Show All 125 Lines • Show Last 20 Lines |