6#include <chainparams.h>
20 std::vector<std::unique_ptr<CWalletTx>> &
wtxs) {
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 ,
79std::vector<std::unique_ptr<CWalletTx>>
wtxn;
83 std::vector<OutputGroup> &
set) {
92 wtxn.emplace_back(std::move(wtx));
100 for (
int i = 0; i <
utxos; ++i) {
120 wallet.SetupLegacyScriptPubKeyMan();
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.
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()
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
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.