Bitcoin
|
#include <miner.h>
Classes | |
struct | Options |
Public Member Functions | |
BlockAssembler (const CChainParams ¶ms) | |
BlockAssembler (const CChainParams ¶ms, const Options &options) | |
std::unique_ptr< CBlockTemplate > | CreateNewBlock (const CScript &scriptPubKeyIn) |
Static Public Attributes | |
static Optional< int64_t > | m_last_block_num_txs {nullopt} |
static Optional< int64_t > | m_last_block_weight {nullopt} |
Private Member Functions | |
void | resetBlock () |
void | AddToBlock (CTxMemPool::txiter iter) |
void | addPackageTxs (int &nPackagesSelected, int &nDescendantsUpdated) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs) |
void | onlyUnconfirmed (CTxMemPool::setEntries &testSet) |
bool | TestPackage (uint64_t packageSize, int64_t packageSigOpsCost) const |
bool | TestPackageTransactions (const CTxMemPool::setEntries &package) |
bool | SkipMapTxEntry (CTxMemPool::txiter it, indexed_modified_transaction_set &mapModifiedTx, CTxMemPool::setEntries &failedTx) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs) |
void | SortForBlock (const CTxMemPool::setEntries &package, std::vector< CTxMemPool::txiter > &sortedEntries) |
int | UpdatePackagesForAdded (const CTxMemPool::setEntries &alreadyAdded, indexed_modified_transaction_set &mapModifiedTx) EXCLUSIVE_LOCKS_REQUIRED(mempool.cs) |
Private Attributes | |
std::unique_ptr< CBlockTemplate > | pblocktemplate |
CBlock * | pblock |
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 | nLockTimeCutoff |
const CChainParams & | chainparams |
Generate a new block, without valid proof-of-work
|
explicit |
BlockAssembler::BlockAssembler | ( | const CChainParams & | params, |
const Options & | options | ||
) |
|
private |
Add transactions based on feerate including unconfirmed ancestors Increments nPackagesSelected / nDescendantsUpdated with corresponding statistics from the package selection (for logging statistics).
|
private |
Add a tx to the block
std::unique_ptr< CBlockTemplate > BlockAssembler::CreateNewBlock | ( | const CScript & | scriptPubKeyIn | ) |
Construct a new block template with coinbase to scriptPubKeyIn
|
private |
Remove confirmed (inBlock) entries from given set
|
private |
Clear the block's state and prepare for assembling a new block
|
private |
Return true if given transaction from mapTx has already been evaluated, or if the transaction's cached data in mapTx is incorrect.
|
private |
Sort the package in an order that is valid to appear in a block
Test if a new package would "fit" in the block
|
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
|
private |
Add descendants of given transactions to mapModifiedTx with ancestor state updated assuming given transactions are inBlock. Returns number of updated descendants.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |