9#include <test/util/setup_common.h>
11#include <validation.h>
33static std::vector<CTransactionRef>
40 for (
auto x = 0; x < 100; ++x) {
45 for (
auto &out : tx.
vout) {
47 out.nValue = 10 *
COIN;
67 tx.
vin.emplace_back();
76 for (
auto &out : tx.
vout) {
79 out.nValue = 10 *
COIN;
91 if (
bench.complexityN() > 1) {
96 const auto testing_setup =
115 testing_setup->PopulateMempool(
det_rand, 400,
true);
117 testing_setup.get()->m_node.chainman->ActiveChainstate().CoinsTip();
static constexpr Amount SATOSHI
static constexpr Amount COIN
static const std::string REGTEST
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
CCoinsView that adds a memory cache for transactions to another CCoinsView.
A mutable version of CTransaction.
std::vector< CTxOut > vout
An outpoint - a combination of a transaction hash and an index n into its vout.
Serialized script, used inside transaction inputs and outputs.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it.
void TrimToSize(size_t sizelimit, std::vector< COutPoint > *pvNoSpendsRemaining=nullptr) EXCLUSIVE_LOCKS_REQUIRED(cs)
Remove transactions from the mempool until its dynamic size is <= sizelimit.
size_t DynamicMemoryUsage() const
CTransactionRef get(const TxId &txid) const
void check(const CCoinsViewCache &active_coins_tip, int64_t spendheight) const EXCLUSIVE_LOCKS_REQUIRED(void addUnchecked(CTxMemPoolEntryRef entry) EXCLUSIVE_LOCKS_REQUIRED(cs
If sanity-checking is turned on, check makes sure the pool is consistent (does not contain two transa...
static RCUPtr make(Args &&...args)
Construct a new object that is owned by the pointer.
Main entry point to nanobench's benchmarking facility.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
static void AddTx(const CTransactionRef &tx, CTxMemPool &pool) EXCLUSIVE_LOCKS_REQUIRED(cs_main
static void MempoolCheck(benchmark::Bench &bench)
static std::vector< CTransactionRef > CreateOrderedCoins(FastRandomContext &det_rand, int childTxs, int min_ancestors)
static void ComplexMemPool(benchmark::Bench &bench)
int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigChecks, unsigned int bytes_per_sigCheck)
Compute the virtual transaction size (size, or more if sigChecks are too dense).
static CTransactionRef MakeTransactionRef()
std::shared_ptr< const CTransaction > CTransactionRef
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...
Available(CTransactionRef &_ref, size_t _tx_count)
A TxId is the identifier of a transaction.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
#define NO_THREAD_SAFETY_ANALYSIS