Bitcoin Core
27.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) | |
BlockAssembler (Chainstate &chainstate, const CTxMemPool *mempool, const Options &options) | |
std::unique_ptr< CBlockTemplate > | CreateNewBlock (const CScript &scriptPubKeyIn) |
Construct a new block template with coinbase to scriptPubKeyIn. More... | |
Static Public Attributes | |
static std::optional< int64_t > | m_last_block_num_txs {} |
static std::optional< int64_t > | m_last_block_weight {} |
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 (const CTxMemPool &mempool, int &nPackagesSelected, int &nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(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 |
|
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 293 of file miner.cpp.
|
private |
std::unique_ptr< CBlockTemplate > node::BlockAssembler::CreateNewBlock | ( | const CScript & | scriptPubKeyIn | ) |
|
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 213 of file miner.cpp.
|
private |
|
private |
|
private |
|
inlinestatic |
|
inlinestatic |
|
private |
|
private |