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>
119 bool TestTxFits(uint64_t txSize, int64_t txSigChecks)
const;
122 bool CheckTx(
const CTransaction &tx)
const;
126 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.
Fee rate in satoshis per kilobyte: Amount / kB.
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.
BlockAssembler(const Config &config, Chainstate &chainstate, const CTxMemPool *mempool, const avalanche::Processor *avalanche=nullptr)
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
uint64_t nMaxGeneratedBlockSize
uint64_t nExcessiveBlockSize
CBlockTemplateEntry(CTransactionRef _tx, Amount _fees, int64_t _sigChecks)
std::vector< CBlockTemplateEntry > entries
#define EXCLUSIVE_LOCKS_REQUIRED(...)