 |
Bitcoin Core
21.99.0
P2P Digital Currency
|
Go to the documentation of this file.
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;
63 assert(setCoinsRet.size() == 2);
71 std::vector<std::unique_ptr<CWalletTx>>
wtxn;
74 static void add_coin(
const CAmount& nValue,
int nInput, std::vector<OutputGroup>& set)
77 tx.
vout.resize(nInput + 1);
78 tx.
vout[nInput].nValue = nValue;
81 set.back().Insert(
COutput(wtx.get(), nInput, 0,
true,
true,
true).
GetInputCoin(), 0,
true, 0, 0,
false);
82 wtxn.emplace_back(std::move(wtx));
89 for (
int i = 0; i < utxos; ++i) {
90 target += (
CAmount)1 << (utxos+i);
101 std::vector<OutputGroup> utxo_pool;
109 SelectCoinsBnB(utxo_pool, target, 0, selection, value_ret, not_input_fees);
std::unique_ptr< WalletDatabase > CreateDummyWalletDatabase()
Return object for accessing dummy database with no read/write capabilities.
static CAmount make_hard_case(int utxos, std::vector< OutputGroup > &utxo_pool)
static void CoinSelection(benchmark::Bench &bench)
std::unique_ptr< Chain > MakeChain(NodeContext &node)
Return implementation of Chain interface.
static void addCoin(const CAmount &nValue, const CWallet &wallet, std::vector< std::unique_ptr< CWalletTx >> &wtxs)
static void add_coin(const CAmount &nValue, int nInput, std::vector< OutputGroup > &set)
Main entry point to nanobench's benchmarking facility.
static CTransactionRef MakeTransactionRef(Tx &&txIn)
static CWallet testWallet(testChain.get(), "", CreateDummyWalletDatabase())
bool SelectCoinsBnB(std::vector< OutputGroup > &utxo_pool, const CAmount &target_value, const CAmount &cost_of_change, std::set< CInputCoin > &out_set, CAmount &value_ret, CAmount not_input_fees)
Fee rate in satoshis per kilobyte: CAmount / kB.
CInputCoin GetInputCoin() const
static NodeContext testNode
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
int64_t CAmount
Amount in satoshis (Can be negative)
void SetupLegacyScriptPubKeyMan()
Make a LegacyScriptPubKeyMan and set it for all types, internal, and external.
std::vector< CTxOut > vout
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
static const CAmount COIN
CoinSelectionParams coin_selection_params(false, 0, 0, CFeeRate(0), CFeeRate(0), CFeeRate(0), 0, false)
std::set< CInputCoin > CoinSet
CoinEligibilityFilter filter_standard(1, 6, 0)
A mutable version of CTransaction.
NodeContext struct containing references to chain state and connection state.
std::vector< std::unique_ptr< CWalletTx > > wtxn
static void BnBExhaustion(benchmark::Bench &bench)
assert(std::addressof(::ChainstateActive().CoinsTip())==std::addressof(coins_cache))