6#ifndef BITCOIN_NODE_MINER_H
7#define BITCOIN_NODE_MINER_H
14#include <boost/multi_index/ordered_index.hpp>
15#include <boost/multi_index_container.hpp>
96 std::unique_ptr<CBlockTemplate>
122 bool CheckTx(
const CTransaction &tx)
const;
const CChainParams & Params()
Return the currently selected parameters.
The block chain is a tree shaped structure starting with the genesis block at the root,...
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Fee rate in satoshis per kilobyte: Amount / kB.
Serialized script, used inside transaction inputs and outputs.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Chainstate stores and provides an API to update our local knowledge of the current best chain.
Generate a new block, without valid proof-of-work.
Chainstate & m_chainstate
uint64_t nMaxGeneratedBlockSize
void resetBlock()
Clear the block's state and prepare for assembling a new block.
const CTxMemPool *const m_mempool
uint64_t GetMaxGeneratedBlockSize() const
std::unique_ptr< CBlockTemplate > CreateNewBlock(const CScript &scriptPubKeyIn)
Construct a new block template with coinbase to scriptPubKeyIn.
const bool fPrintPriority
const CChainParams & chainParams
int64_t m_lock_time_cutoff
static std::optional< int64_t > m_last_block_size
std::unique_ptr< CBlockTemplate > pblocktemplate
bool CheckTx(const CTransaction &tx) const
Check the transaction for finality, etc before adding to block.
static std::optional< int64_t > m_last_block_num_txs
void AddToBlock(const CTxMemPoolEntryRef &entry)
Add a tx to the block.
void addTxs(const CTxMemPool &mempool) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs)
Add transactions from the mempool based on individual tx feerate.
bool TestTxFits(uint64_t txSize, int64_t txSigChecks) const
Test if a new Tx would "fit" in the block.
uint64_t nMaxGeneratedBlockSigChecks
const avalanche::Processor *const m_avalanche
static const bool DEFAULT_PRINTPRIORITY
int64_t UpdateTime(CBlockHeader *pblock, const CChainParams &chainParams, const CBlockIndex *pindexPrev, int64_t adjustedTime)
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...
uint64_t nMaxGeneratedBlockSize
uint64_t nExcessiveBlockSize
CBlockTemplateEntry(CTransactionRef _tx, Amount _fees, int64_t _sigChecks)
std::vector< CBlockTemplateEntry > entries
#define EXCLUSIVE_LOCKS_REQUIRED(...)