![]() |
Bitcoin Core 28.99.0
P2P Digital Currency
|
Generate a new block, without valid proof-of-work. More...
#include <miner.h>
Classes | |
struct | Options |
Public Member Functions | |
BlockAssembler (Chainstate &chainstate, const CTxMemPool *mempool, const Options &options) | |
std::unique_ptr< CBlockTemplate > | CreateNewBlock () |
Construct a new block template. More... | |
Static Public Attributes | |
static std::optional< int64_t > | m_last_block_num_txs {} |
The number of transactions in the last assembled block (excluding coinbase transaction) More... | |
static std::optional< int64_t > | m_last_block_weight {} |
The weight of the last assembled block (including reserved weight for block header, txs count and coinbase tx) More... | |
Private Member Functions | |
void | resetBlock () |
Clear the block's state and prepare for assembling a new block. More... | |
void | AddToBlock (CTxMemPool::txiter iter) |
Add a tx to the block. More... | |
void | addPackageTxs (int &nPackagesSelected, int &nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(!m_mempool -> cs) |
Add transactions based on feerate including unconfirmed ancestors Increments nPackagesSelected / nDescendantsUpdated with corresponding statistics from the package selection (for logging statistics). More... | |
void | onlyUnconfirmed (CTxMemPool::setEntries &testSet) |
Remove confirmed (inBlock) entries from given set. More... | |
bool | TestPackage (uint64_t packageSize, int64_t packageSigOpsCost) const |
Test if a new package would "fit" in the block. More... | |
bool | TestPackageTransactions (const CTxMemPool::setEntries &package) const |
Perform checks on each transaction in a package: locktime, premature-witness, serialized size (if necessary) These checks should always succeed, and they're here only as an extra check in case of suboptimal node configuration. More... | |
void | SortForBlock (const CTxMemPool::setEntries &package, std::vector< CTxMemPool::txiter > &sortedEntries) |
Sort the package in an order that is valid to appear in a block. More... | |
Private Attributes | |
std::unique_ptr< CBlockTemplate > | pblocktemplate |
uint64_t | nBlockWeight |
uint64_t | nBlockTx |
uint64_t | nBlockSigOpsCost |
CAmount | nFees |
std::unordered_set< Txid, SaltedTxidHasher > | inBlock |
int | nHeight |
int64_t | m_lock_time_cutoff |
const CChainParams & | chainparams |
const CTxMemPool *const | m_mempool |
Chainstate & | m_chainstate |
const Options | m_options |
|
explicit |
|
private |
Add transactions based on feerate including unconfirmed ancestors Increments nPackagesSelected / nDescendantsUpdated with corresponding statistics from the package selection (for logging statistics).
Return true if given transaction from mapTx has already been evaluated, or if the transaction's cached data in mapTx is incorrect.
Definition at line 299 of file miner.cpp.
|
private |
std::unique_ptr< CBlockTemplate > node::BlockAssembler::CreateNewBlock | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
Perform checks on each transaction in a package: locktime, premature-witness, serialized size (if necessary) These checks should always succeed, and they're here only as an extra check in case of suboptimal node configuration.
Definition at line 220 of file miner.cpp.
|
private |
|
private |
|
private |
|
inlinestatic |
|
inlinestatic |
|
private |
|
private |