Generate a new block, without valid proof-of-work.
More...
#include <miner.h>
|
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...
|
|
bool | AttemptToAddContractToBlock (CTxMemPool::txiter iter, uint64_t minGasPrice) |
|
void | addPackageTxs (int &nPackagesSelected, int &nDescendantsUpdated, uint64_t minGasPrice) |
| Add transactions based on feerate including unconfirmed ancestors Increments nPackagesSelected / nDescendantsUpdated with corresponding statistics from the package selection (for logging statistics). More...
|
|
void | RebuildRefundTransaction () |
| Rebuild the coinbase/coinstake transaction to account for new gas refunds. More...
|
|
void | onlyUnconfirmed (CTxMemPool::setEntries &testSet) |
| Remove confirmed (inBlock) entries from given set. More...
|
|
bool | TestPackage (uint64_t packageSize, int64_t packageSigOpsCost) |
| Test if a new package would "fit" in the block. More...
|
|
bool | TestPackageTransactions (const CTxMemPool::setEntries &package) |
| 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) |
| 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, CTxMemPool::txiter entry, 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) |
| Add descendants of given transactions to mapModifiedTx with ancestor state updated assuming given transactions are inBlock. More...
|
|
Generate a new block, without valid proof-of-work.
Definition at line 187 of file miner.h.
BlockAssembler::BlockAssembler |
( |
const CChainParams & |
params | ) |
|
void BlockAssembler::addPackageTxs |
( |
int & |
nPackagesSelected, |
|
|
int & |
nDescendantsUpdated, |
|
|
uint64_t |
minGasPrice |
|
) |
| |
|
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 554 of file miner.cpp.
Add a tx to the block.
Definition at line 472 of file miner.cpp.
bool BlockAssembler::AttemptToAddContractToBlock |
( |
CTxMemPool::txiter |
iter, |
|
|
uint64_t |
minGasPrice |
|
) |
| |
|
private |
std::unique_ptr< CBlockTemplate > BlockAssembler::CreateNewBlock |
( |
const CScript & |
scriptPubKeyIn, |
|
|
bool |
fMineWitnessTx = true , |
|
|
int64_t * |
pTotalFees = 0 , |
|
|
int32_t |
nTime = 0 , |
|
|
int32_t |
nTimeLimit = 0 |
|
) |
| |
Construct a new block template with coinbase to scriptPubKeyIn.
!! LogPrintf("CreateNewBlock(): block weight: %u txs: %u fees: %ld sigops %d\n", GetBlockWeight(*pblock), nBlockTx, nFees, nBlockSigOpsCost);
Definition at line 153 of file miner.cpp.
Remove confirmed (inBlock) entries from given set.
Definition at line 299 of file miner.cpp.
void BlockAssembler::RebuildRefundTransaction |
( |
| ) |
|
|
private |
Rebuild the coinbase/coinstake transaction to account for new gas refunds.
Definition at line 137 of file miner.cpp.
void BlockAssembler::resetBlock |
( |
| ) |
|
|
private |
Clear the block's state and prepare for assembling a new block.
Definition at line 123 of file miner.cpp.
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 527 of file miner.cpp.
Sort the package in an order that is valid to appear in a block.
Definition at line 533 of file miner.cpp.
bool BlockAssembler::TestPackage |
( |
uint64_t |
packageSize, |
|
|
int64_t |
packageSigOpsCost |
|
) |
| |
|
private |
Test if a new package would "fit" in the block.
Definition at line 312 of file miner.cpp.
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 326 of file miner.cpp.
Add descendants of given transactions to mapModifiedTx with ancestor state updated assuming given transactions are inBlock.
Returns number of updated descendants.
Definition at line 491 of file miner.cpp.
Construct a new block template with coinbase to scriptPubKeyIn.
Definition at line 226 of file miner.h.
CFeeRate BlockAssembler::blockMinFeeRate |
|
private |
bool BlockAssembler::fIncludeWitness |
|
private |
uint64_t BlockAssembler::hardBlockGasLimit |
uint64_t BlockAssembler::minGasPrice = 1 |
unsigned int BlockAssembler::nBlockMaxWeight |
|
private |
uint64_t BlockAssembler::nBlockSigOpsCost |
|
private |
uint64_t BlockAssembler::nBlockTx |
|
private |
uint64_t BlockAssembler::nBlockWeight |
|
private |
int BlockAssembler::nHeight |
|
private |
int64_t BlockAssembler::nLockTimeCutoff |
|
private |
int32_t BlockAssembler::nTimeLimit |
CBlock* BlockAssembler::pblock |
|
private |
uint64_t BlockAssembler::softBlockGasLimit |
uint64_t BlockAssembler::txGasLimit |
The documentation for this class was generated from the following files: