38std::deque<COutPoint> g_available_coins;
39void initialize_miner()
42 for (uint32_t i = 0; i < uint32_t{100}; ++i) {
56 std::vector<COutPoint> outpoints;
57 std::deque<COutPoint> available_coins = g_available_coins;
64 for (
size_t n{0}; n < num_inputs; ++n) {
65 auto prevout = available_coins.front();
67 available_coins.pop_front();
69 for (uint32_t n{0}; n < num_outputs; ++n) {
70 mtx.
vout.emplace_back(100, P2WSH_OP_TRUE);
79 for (uint32_t n{0}; n < num_outputs; ++n) {
81 available_coins.emplace_back(tx->GetHash(), n);
85 if (fuzzed_data_provider.
ConsumeBool() && !tx->vout.empty()) {
87 outpoints.emplace_back(tx->GetHash(),
93 if (outpoint.has_value() && std::find(outpoints.begin(), outpoints.end(), *outpoint) == outpoints.end()) {
94 outpoints.push_back(*outpoint);
100 std::optional<CAmount> total_bumpfee;
106 for (
const auto& outpoint : outpoints) {
107 auto it = bump_fees.find(outpoint);
108 assert(it != bump_fees.end());
110 sum_fees += it->second;
118 assert(total_bumpfee.has_value());
122 assert (sum_fees >= *total_bumpfee);
constexpr CAmount MAX_MONEY
No amount larger than this (in satoshi) is valid.
bool MoneyRange(const CAmount &nValue)
int64_t CAmount
Amount in satoshis (Can be negative).
TryAddToMempool(pool, CTxMemPoolEntry(tx, fee, 0, 1, 0, false, 4, lp))
#define Assert(val)
Identity function.
Fee rate in satoshis per virtualbyte: CAmount / vB the feerate is represented internally as FeeFrac.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
kernel::MemPoolOptions Options
Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
T ConsumeIntegralInRange(T min, T max)
A minimal version of BlockAssembler, using the same ancestor set scoring algorithm.
std::map< COutPoint, CAmount > CalculateBumpFees(const CFeeRate &target_feerate)
Construct a new block template and, for each outpoint corresponding to a transaction that did not mak...
std::optional< CAmount > CalculateTotalBumpFees(const CFeeRate &target_feerate)
Construct a new block template and, calculate the cost of bumping all transactions that did not make ...
bool IsReadyToCalculate() const
Returns true if CalculateBumpFees may be called, false if not.
static transaction_identifier FromUint256(const uint256 &id)
static const uint256 ZERO
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
std::shared_ptr< const CTransaction > CTransactionRef
std::unique_ptr< T > MakeNoLogFileContext(const ChainType chain_type=ChainType::REGTEST, TestOpts opts={})
Make a test setup that has disk access to the debug.log file disabled.
A mutable version of CTransaction.
std::vector< CTxOut > vout
CTxMemPoolEntry FromTx(const CMutableTransaction &tx) const
TestMemPoolEntryHelper & Fee(CAmount _fee)
SeedRandomStateForTest(SeedRand::ZEROS)
NodeSeconds ConsumeTime(FuzzedDataProvider &fuzzed_data_provider, const std::optional< int64_t > &min, const std::optional< int64_t > &max) noexcept
CAmount ConsumeMoney(FuzzedDataProvider &fuzzed_data_provider, const std::optional< CAmount > &max) noexcept
std::optional< T > ConsumeDeserializable(FuzzedDataProvider &fuzzed_data_provider, const P ¶ms, const std::optional< size_t > &max_length=std::nullopt) noexcept
@ ZEROS
Seed with a compile time constant of zeros.