15 #include <test/util/setup_common.h>
20 TestingSetup test_setup{
39 CBlockIndex *pindexPrev = test_setup.m_node.chainman->ActiveChain().Tip();
40 assert(pindexPrev !=
nullptr);
46 coinbaseTx.vin.resize(1);
48 coinbaseTx.vout.resize(1);
49 coinbaseTx.vout[0].scriptPubKey = SCRIPT_PUB;
53 naughtyTx.vout.resize(1);
55 naughtyTx.vout[0].scriptPubKey = SCRIPT_PUB;
59 for (uint64_t x = 0; x < (n_inputs - 1); ++x) {
62 naughtyTx.vin.emplace_back(naughtyTx.vin.back());
74 .withCheckMerkleRoot(
false)));
75 assert(cvstate.GetRejectReason() ==
"bad-txns-inputs-duplicate");
RecursiveMutex cs_main
Global state.
const CChainParams & Params()
Return the currently selected parameters.
static const std::string REGTEST
The block chain is a tree shaped structure starting with the genesis block at the root,...
int nHeight
height of the entry in the chain. The genesis block has height 0
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
const Consensus::Params & GetConsensus() const
A mutable version of CTransaction.
An outpoint - a combination of a transaction hash and an index n into its vout.
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
unsigned int GetTotalSize() const
Get the total transaction size in bytes.
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
const Config & GetConfig()
static const uint64_t MAX_TX_SIZE
The maximum allowed size for a transaction, in bytes.
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
Compute the Merkle root of the transactions in a block.
bool CheckBlock(const CCheckpointData &data, int nHeight, const BlockHash &hash)
Returns true if block passes checkpoint checks.
uint32_t GetNextWorkRequired(const CBlockIndex *pindexPrev, const CBlockHeader *pblock, const CChainParams &chainParams)
static CTransactionRef MakeTransactionRef()
uint256 GetRandHash() noexcept
static constexpr Amount zero()
Parameters that influence chain consensus.
A TxId is the identifier of a transaction.
Amount GetBlockSubsidy(int nHeight, const Consensus::Params &consensusParams)