![]() |
Bitcoin ABC 0.32.4
P2P Digital Currency
|
Generate a new block, without valid proof-of-work. More...
#include <miner.h>
Classes | |
| struct | Options |
Public Member Functions | |
| BlockAssembler (const Config &config, Chainstate &chainstate, const CTxMemPool *mempool, const avalanche::Processor *avalanche=nullptr) | |
| BlockAssembler (const node::BlockFitter &fitter, Chainstate &chainstate, const CTxMemPool *mempool, const avalanche::Processor *avalanche=nullptr) | |
| BlockAssembler (const node::BlockFitter &fitter, Chainstate &chainstate, const CTxMemPool *mempool, const Options &options, const avalanche::Processor *avalanche=nullptr) | |
| std::unique_ptr< CBlockTemplate > | CreateNewBlock (const CScript &scriptPubKeyIn) |
| Construct a new block template with coinbase to scriptPubKeyIn. More... | |
| uint64_t | GetMaxGeneratedBlockSize () const |
| void | addTxs (const CTxMemPool &mempool) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs) |
| Add transactions from the mempool based on individual tx feerate. More... | |
| void | addFinalizedTxs (const CTxMemPool &mempool) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs) |
| Add the finalized transactions to the block template. More... | |
Public Attributes | |
| std::unique_ptr< CBlockTemplate > | pblocktemplate |
Static Public Attributes | |
| static std::optional< int64_t > | m_last_block_num_txs {std::nullopt} |
| static std::optional< int64_t > | m_last_block_size {std::nullopt} |
Private Member Functions | |
| void | resetBlock () |
| Clear the block's state and prepare for assembling a new block. More... | |
| void | AddToBlock (const CTxMemPoolEntryRef &entry) |
| Add a tx to the block. More... | |
| bool | CheckTx (const CTransaction &tx) const |
| Check the transaction for finality, etc before adding to block. More... | |
Private Attributes | |
| BlockFitter | blockFitter |
| int | nHeight |
| int64_t | m_lock_time_cutoff |
| const CChainParams & | chainParams |
| const CTxMemPool *const | m_mempool |
| Chainstate & | m_chainstate |
| const avalanche::Processor *const | m_avalanche |
| const bool | fPrintPriority |
| const bool | test_block_validity |
| const bool | add_finalized_txs |
| node::BlockAssembler::BlockAssembler | ( | const Config & | config, |
| Chainstate & | chainstate, | ||
| const CTxMemPool * | mempool, | ||
| const avalanche::Processor * | avalanche = nullptr |
||
| ) |
| node::BlockAssembler::BlockAssembler | ( | const node::BlockFitter & | fitter, |
| Chainstate & | chainstate, | ||
| const CTxMemPool * | mempool, | ||
| const avalanche::Processor * | avalanche = nullptr |
||
| ) |
| node::BlockAssembler::BlockAssembler | ( | const node::BlockFitter & | fitter, |
| Chainstate & | chainstate, | ||
| const CTxMemPool * | mempool, | ||
| const Options & | options, | ||
| const avalanche::Processor * | avalanche = nullptr |
||
| ) |
| void node::BlockAssembler::addFinalizedTxs | ( | const CTxMemPool & | mempool | ) |
Add the finalized transactions to the block template.
addFinalizedTxs fills the template with the finalized transactons.
The radix tree is making sure it's all ready to go and already sorted so there is no check to do anymore.
Definition at line 399 of file miner.cpp.
|
private |
| void node::BlockAssembler::addTxs | ( | const CTxMemPool & | mempool | ) |
Add transactions from the mempool based on individual tx feerate.
addTxs includes transactions paying a fee by ensuring that the partial ordering of transactions is maintained.
That is to say children come after parents, despite having a potentially larger fee.
Definition at line 271 of file miner.cpp.
|
private |
| std::unique_ptr< CBlockTemplate > node::BlockAssembler::CreateNewBlock | ( | const CScript & | scriptPubKeyIn | ) |
|
inline |
|
private |
Clear the block's state and prepare for assembling a new block.
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
|
private |
| std::unique_ptr<CBlockTemplate> node::BlockAssembler::pblocktemplate |