15 static int nextLockTime = 0;
19 tx.
vout[0].nValue = nValue;
35 wallet.SetupLegacyScriptPubKeyMan();
36 std::vector<std::unique_ptr<CWalletTx>> wtxs;
40 for (
int i = 0; i < 1000; ++i) {
46 std::vector<COutput> coins;
47 for (
const auto& wtx : wtxs) {
48 coins.emplace_back(wtx.get(), 0 , 6 * 24 ,
true ,
true ,
true );
57 std::set<CInputCoin> setCoinsRet;
62 assert(setCoinsRet.size() == 2);
70 std::vector<std::unique_ptr<CWalletTx>>
wtxn;
73 static void add_coin(
const CAmount& nValue,
int nInput, std::vector<OutputGroup>&
set)
76 tx.
vout.resize(nInput + 1);
77 tx.
vout[nInput].nValue = nValue;
80 set.back().Insert(
COutput(wtx.get(), nInput, 0,
true,
true,
true).GetInputCoin(), 0,
true, 0, 0,
false);
81 wtxn.emplace_back(std::move(wtx));
88 for (
int i = 0; i < utxos; ++i) {
89 target += (
CAmount)1 << (utxos+i);
100 std::vector<OutputGroup> utxo_pool;
void SetupLegacyScriptPubKeyMan()
Make a LegacyScriptPubKeyMan and set it for all types, internal, and external.
std::set< CInputCoin > CoinSet
static const CAmount COIN
CoinEligibilityFilter filter_standard(1, 6, 0)
std::vector< std::unique_ptr< CWalletTx > > wtxn
std::unique_ptr< Chain > MakeChain(NodeContext &node)
Return implementation of Chain interface.
bool SelectCoinsBnB(std::vector< OutputGroup > &utxo_pool, const CAmount &selection_target, const CAmount &cost_of_change, std::set< CInputCoin > &out_set, CAmount &value_ret)
int64_t CAmount
Amount in satoshis (Can be negative)
Parameters for filtering which OutputGroups we may use in coin selection.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
NodeContext struct containing references to chain state and connection state.
static CWallet testWallet(testChain.get(), "", CreateDummyWalletDatabase())
static CAmount make_hard_case(int utxos, std::vector< OutputGroup > &utxo_pool)
std::unique_ptr< WalletDatabase > CreateDummyWalletDatabase()
Return object for accessing dummy database with no read/write capabilities.
std::vector< CTxOut > vout
static void add_coin(const CAmount &nValue, int nInput, std::vector< OutputGroup > &set)
static CTransactionRef MakeTransactionRef(Tx &&txIn)
static void addCoin(const CAmount &nValue, const CWallet &wallet, std::vector< std::unique_ptr< CWalletTx >> &wtxs)
static NodeContext testNode
CoinSelectionParams coin_selection_params(0, 0, CFeeRate(0), CFeeRate(0), CFeeRate(0), 0, false)
static void CoinSelection(benchmark::Bench &bench)
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Parameters for one iteration of Coin Selection.
Fee rate in satoshis per kilobyte: CAmount / kB.
A mutable version of CTransaction.
Main entry point to nanobench's benchmarking facility.
static void BnBExhaustion(benchmark::Bench &bench)