6#ifndef BITCOIN_NODE_MINER_H
7#define BITCOIN_NODE_MINER_H
15#include <boost/multi_index/ordered_index.hpp>
16#include <boost/multi_index_container.hpp>
81 std::unique_ptr<CBlockTemplate>
105 bool CheckTx(
const CTransaction &tx)
const;
109 const CBlockIndex *pindexPrev, int64_t adjustedTime);
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.
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
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.
BlockAssembler(const Config &config, Chainstate &chainstate, const CTxMemPool *mempool, const avalanche::Processor *avalanche=nullptr)
const avalanche::Processor *const m_avalanche
Check for block limits when adding transactions.
uint64_t getMaxGeneratedBlockSize() const
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
CBlockTemplateEntry(CTransactionRef _tx, Amount _fees, int64_t _sigChecks)
std::vector< CBlockTemplateEntry > entries
#define EXCLUSIVE_LOCKS_REQUIRED(...)