26 .extra_args = {
"-testactivationheight=bip34@2"},
31 auto&
node{test_setup.m_node};
32 auto& chainman{*
Assert(test_setup.m_node.chainman)};
35 const auto ActiveHeight = [&]() {
36 LOCK(chainman.GetMutex());
37 return chainman.ActiveHeight();
39 const auto PrepareNextBlock = [&]() {
52 auto current_block = PrepareNextBlock();
54 std::vector<std::pair<COutPoint, CTxOut>> txos;
62 const auto StoreLastTxo = [&]() {
66 const uint32_t i = tx.
vout.size() - 1;
69 if (current_block->vtx.size() == 1 && tx.
vout.at(i).scriptPubKey[0] ==
OP_RETURN) {
71 const uint32_t i = tx.
vout.size() - 2;
77 tx.vin.emplace_back(txo.first);
78 tx.vout.emplace_back(txo.second.nValue, txo.second.scriptPubKey);
80 const auto UpdateUtxoStats = [&]() {
81 LOCK(chainman.GetMutex());
82 chainman.ActiveChainstate().ForceFlushStateToDisk();
83 utxo_stats = std::move(
93 assert(ActiveHeight() == 0);
99 const CScript duplicate_coinbase_script =
CScript() << duplicate_coinbase_height <<
OP_0;
101 current_block = PrepareNextBlock();
107 tx.
vin.at(0).scriptSig = duplicate_coinbase_script;
116 assert(ActiveHeight() == 1);
118 current_block = PrepareNextBlock();
126 fuzzed_data_provider,
146 const auto prev_utxo_stats = utxo_stats;
148 if (duplicate_coinbase_height == ActiveHeight()) {
150 assert(current_block->vtx.at(0)->vin.at(0).scriptSig == duplicate_coinbase_script);
163 current_block = PrepareNextBlock();
static bool ComputeUTXOStats(CCoinsView *view, CCoinsStats &stats, T hash_obj, const std::function< void()> &interruption_point)
Calculate statistics about the unspent transaction output set.