16 std::vector<std::unique_ptr<CWalletTx>> &wtxs) {
17 static int nextLockTime = 0;
22 tx.
vout[0].nValue = nValue;
23 wtxs.push_back(std::make_unique<CWalletTx>(
42 std::vector<std::unique_ptr<CWalletTx>> wtxs;
43 LOCK(wallet.cs_wallet);
46 for (
int i = 0; i < 1000; ++i) {
52 std::vector<OutputGroup> groups;
53 for (
const auto &wtx : wtxs) {
54 COutput output(wtx.get(), 0 , 6 * 24 ,
57 groups.emplace_back(output.GetInputCoin(), 6,
false, 0, 0);
64 std::set<CInputCoin> setCoinsRet;
67 bool success = wallet.SelectCoinsMinConf(
68 1003 *
COIN, filter_standard, groups, setCoinsRet, nValueRet,
69 coin_selection_params, bnb_used);
71 assert(nValueRet == 1003 *
COIN);
72 assert(setCoinsRet.size() == 2);
77 std::vector<std::unique_ptr<CWalletTx>>
wtxn;
81 std::vector<OutputGroup> &
set) {
83 tx.
vout.resize(nInput + 1);
84 tx.
vout[nInput].nValue = nValue;
88 COutput(wtx.get(), nInput, 0,
true,
true,
true).GetInputCoin(), 0,
true,
90 wtxn.emplace_back(std::move(wtx));
95 std::vector<OutputGroup> &utxo_pool) {
98 for (
int i = 0; i < utxos; ++i) {
101 add_coin(wallet, base, 2 * i, utxo_pool);
103 2 * i + 1, utxo_pool);
116 LOCK(wallet.cs_wallet);
119 wallet.SetupLegacyScriptPubKeyMan();
120 std::vector<OutputGroup> utxo_pool;
static std::unique_ptr< BerkeleyDatabase > CreateDummy()
Return object for accessing dummy database with no read/write capabilities.
void SetupLegacyScriptPubKeyMan()
Make a LegacyScriptPubKeyMan and set it for all types, internal, and external.
std::set< CInputCoin > CoinSet
static constexpr Amount zero()
static const std::string REGTEST
static void BnBExhaustion(benchmark::State &state)
CoinSelectionParams coin_selection_params(false, 0, 0, CFeeRate(Amount::zero()), 0)
static CTransactionRef MakeTransactionRef()
CoinEligibilityFilter filter_standard(1, 6, 0)
static constexpr Amount SATOSHI
std::vector< CTxOut > vout
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)
std::vector< std::unique_ptr< CWalletTx > > wtxn
static Amount make_hard_case(const CWallet &wallet, int utxos, std::vector< OutputGroup > &utxo_pool)
static void addCoin(const Amount nValue, const CWallet &wallet, std::vector< std::unique_ptr< CWalletTx >> &wtxs)
NodeContext struct containing references to chain state and connection state.
static constexpr Amount COIN
static void add_coin(const CWallet &wallet, const Amount nValue, int nInput, std::vector< OutputGroup > &set)
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given BIP70 chain name.
const CChainParams & Params()
Return the currently selected parameters.
A mutable version of CTransaction.
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Fee rate in satoshis per kilobyte: Amount / kB.
static void CoinSelection(benchmark::State &state)
The WalletLocation class provides wallet information.
BENCHMARK(CoinSelection, 650)
std::unique_ptr< Chain > MakeChain(NodeContext &node, const CChainParams ¶ms)
Return implementation of Chain interface.