Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/coinselection.h
// Copyright (c) 2017 The Bitcoin Core developers | // Copyright (c) 2017 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_COINSELECTION_H | #ifndef BITCOIN_WALLET_COINSELECTION_H | ||||
#define BITCOIN_COINSELECTION_H | #define BITCOIN_WALLET_COINSELECTION_H | ||||
#include <amount.h> | #include <amount.h> | ||||
#include <primitives/transaction.h> | #include <primitives/transaction.h> | ||||
#include <random.h> | #include <random.h> | ||||
//! target minimum change amount | //! target minimum change amount | ||||
static const Amount MIN_CHANGE = CENT; | static const Amount MIN_CHANGE = CENT; | ||||
//! final minimum change amount after paying for fees | //! final minimum change amount after paying for fees | ||||
Show All 37 Lines | 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, | ||||
const Amount not_input_fees); | const Amount not_input_fees); | ||||
// Original coin selection algorithm as a fallback | // Original coin selection algorithm as a fallback | ||||
bool KnapsackSolver(const Amount nTargetValue, std::vector<CInputCoin> &vCoins, | bool KnapsackSolver(const Amount nTargetValue, std::vector<CInputCoin> &vCoins, | ||||
std::set<CInputCoin> &setCoinsRet, Amount &nValueRet); | std::set<CInputCoin> &setCoinsRet, Amount &nValueRet); | ||||
#endif // BITCOIN_COINSELECTION_H | #endif // BITCOIN_WALLET_COINSELECTION_H |