Bitcoin Core
22.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 (CChainState &chainstate, const CTxMemPool &mempool, const CChainParams ¶ms) | |
BlockAssembler (CChainState &chainstate, const CTxMemPool &mempool, const CChainParams ¶ms, 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 (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... | |
bool | SkipMapTxEntry (CTxMemPool::txiter it, indexed_modified_transaction_set &mapModifiedTx, CTxMemPool::setEntries &failedTx) EXCLUSIVE_LOCKS_REQUIRED(m_mempool.cs) |
Return true if given transaction from mapTx has already been evaluated, or if the transaction's cached data in mapTx is incorrect. 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... | |
int | UpdatePackagesForAdded (const CTxMemPool::setEntries &alreadyAdded, indexed_modified_transaction_set &mapModifiedTx) EXCLUSIVE_LOCKS_REQUIRED(m_mempool.cs) |
Add descendants of given transactions to mapModifiedTx with ancestor state updated assuming given transactions are inBlock. More... | |
Private Attributes | |
std::unique_ptr< CBlockTemplate > | pblocktemplate |
bool | fIncludeWitness |
unsigned int | nBlockMaxWeight |
CFeeRate | blockMinFeeRate |
uint64_t | nBlockWeight |
uint64_t | nBlockTx |
uint64_t | nBlockSigOpsCost |
CAmount | nFees |
CTxMemPool::setEntries | inBlock |
int | nHeight |
int64_t | m_lock_time_cutoff |
const CChainParams & | chainparams |
const CTxMemPool & | m_mempool |
CChainState & | m_chainstate |
|
explicit |
|
explicit |
|
private |
Add transactions based on feerate including unconfirmed ancestors Increments nPackagesSelected / nDescendantsUpdated with corresponding statistics from the package selection (for logging statistics).
Definition at line 319 of file miner.cpp.
|
private |
std::unique_ptr< CBlockTemplate > BlockAssembler::CreateNewBlock | ( | const CScript & | scriptPubKeyIn | ) |
|
private |
|
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 219 of file miner.cpp.
|
private |
|
private |
|
private |
|
private |
|
inlinestatic |
|
inlinestatic |
|
private |
|
private |