6#include <chainparams.h>
20 std::vector<std::unique_ptr<CWalletTx>> &wtxs) {
21 static int nextLockTime = 0;
26 tx.
vout[0].nValue = nValue;
44 wallet.SetupLegacyScriptPubKeyMan();
45 std::vector<std::unique_ptr<CWalletTx>> wtxs;
49 for (
int i = 0; i < 1000; ++i) {
55 std::vector<COutput> coins;
56 for (
const auto &wtx : wtxs) {
57 coins.emplace_back(
wallet, *wtx, 0 , 6 * 24 ,
66 std::set<CInputCoin> setCoinsRet;
70 coins, setCoinsRet, nValueRet,
74 assert(setCoinsRet.size() == 2);
79std::vector<std::unique_ptr<CWalletTx>>
wtxn;
83 std::vector<OutputGroup> &set) {
85 tx.
vout.resize(nInput + 1);
86 tx.
vout[nInput].nValue = nValue;
90 COutput(
wallet, *wtx, nInput, 0,
true,
true,
true).GetInputCoin(), 0,
92 wtxn.emplace_back(std::move(wtx));
97 std::vector<OutputGroup> &utxo_pool) {
100 for (
int i = 0; i < utxos; ++i) {
105 2 * i + 1, utxo_pool);
120 wallet.SetupLegacyScriptPubKeyMan();
121 std::vector<OutputGroup> utxo_pool;
static constexpr Amount SATOSHI
static constexpr Amount COIN
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.
static const std::string REGTEST
Fee rate in satoshis per kilobyte: Amount / kB.
A mutable version of CTransaction.
std::vector< CTxOut > vout
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
static void CoinSelection(benchmark::Bench &bench)
static void addCoin(const Amount nValue, const CWallet &wallet, std::vector< std::unique_ptr< CWalletTx > > &wtxs)
static void add_coin(const CWallet &wallet, const Amount nValue, int nInput, std::vector< OutputGroup > &set)
static void BnBExhaustion(benchmark::Bench &bench)
std::vector< std::unique_ptr< CWalletTx > > wtxn
std::set< CInputCoin > CoinSet
static Amount make_hard_case(const CWallet &wallet, int utxos, std::vector< OutputGroup > &utxo_pool)
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.
CoinSelectionParams coin_selection_params(false, 0, 0, CFeeRate(Amount::zero()), 0, false)
CoinEligibilityFilter filter_standard(1, 6)
std::unique_ptr< Chain > MakeChain(node::NodeContext &node, const CChainParams ¶ms)
Return implementation of Chain interface.
static CTransactionRef MakeTransactionRef()
bool SelectCoinsMinConf(const CWallet &wallet, const Amount nTargetValue, const CoinEligibilityFilter &eligibility_filter, std::vector< COutput > coins, std::set< CInputCoin > &setCoinsRet, Amount &nValueRet, const CoinSelectionParams &coin_selection_params, bool &bnb_used)
Shuffle and select coins until nTargetValue is reached while avoiding small change; This method is st...
static constexpr Amount zero() noexcept
NodeContext struct containing references to chain state and connection state.
std::unique_ptr< WalletDatabase > CreateDummyWalletDatabase()
Return object for accessing dummy database with no read/write capabilities.