![]() |
PIVX Core
5.6.99
P2P Digital Currency
|
Generate a new block. More...
#include <blockassembler.h>
Public Member Functions | |
| BlockAssembler (const CChainParams &chainparams, const bool defaultPrintPriority) | |
| std::unique_ptr< CBlockTemplate > | CreateNewBlock (const CScript &scriptPubKeyIn, CWallet *pwallet=nullptr, bool fProofOfStake=false, std::vector< CStakeableOutput > *availableCoins=nullptr, bool fNoMempoolTx=false, bool fTestValidity=true, CBlockIndex *prevBlock=nullptr, bool stopPoSOnNewBlock=true, bool fIncludeQfc=true) |
| Construct a new block template with coinbase to scriptPubKeyIn. 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 () |
| Add transactions based on feerate including unconfirmed ancestors. More... | |
| void | appendSaplingTreeRoot () |
| Add the tip updated incremental merkle tree to the header. More... | |
| void | onlyUnconfirmed (CTxMemPool::setEntries &testSet) |
| Remove confirmed (inBlock) entries from given set. More... | |
| bool | TestPackage (uint64_t packageSize, unsigned int packageSigOps) |
| Test if a new package would "fit" in the block. More... | |
| bool | TestPackageFinality (const CTxMemPool::setEntries &package) |
| Test if a set of transactions are all final. 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... | |
| void | 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... | |
Private Attributes | |
| std::unique_ptr< CBlockTemplate > | pblocktemplate |
| CBlock * | pblock {nullptr} |
| unsigned int | nBlockMaxSize {0} |
| uint64_t | nBlockSize {0} |
| uint64_t | nBlockTx {0} |
| unsigned int | nBlockSigOps {0} |
| CAmount | nFees {0} |
| CTxMemPool::setEntries | inBlock |
| int | nHeight {0} |
| const CChainParams & | chainparams |
| unsigned int | nSizeShielded {0} |
| const bool | defaultPrintPriority {false} |
Generate a new block.
Definition at line 134 of file blockassembler.h.
| BlockAssembler::BlockAssembler | ( | const CChainParams & | chainparams, |
| const bool | defaultPrintPriority | ||
| ) |
|
private |
Add transactions based on feerate including unconfirmed ancestors.
Definition at line 376 of file blockassembler.cpp.
|
private |
Add a tx to the block.
Definition at line 295 of file blockassembler.cpp.
|
private |
Add the tip updated incremental merkle tree to the header.
Definition at line 499 of file blockassembler.cpp.
| std::unique_ptr< CBlockTemplate > BlockAssembler::CreateNewBlock | ( | const CScript & | scriptPubKeyIn, |
| CWallet * | pwallet = nullptr, |
||
| bool | fProofOfStake = false, |
||
| std::vector< CStakeableOutput > * | availableCoins = nullptr, |
||
| bool | fNoMempoolTx = false, |
||
| bool | fTestValidity = true, |
||
| CBlockIndex * | prevBlock = nullptr, |
||
| bool | stopPoSOnNewBlock = true, |
||
| bool | fIncludeQfc = true |
||
| ) |
Construct a new block template with coinbase to scriptPubKeyIn.
Definition at line 158 of file blockassembler.cpp.
|
private |
Remove confirmed (inBlock) entries from given set.
Definition at line 262 of file blockassembler.cpp.
|
private |
Clear the block's state and prepare for assembling a new block.
Definition at line 145 of file blockassembler.cpp.
|
private |
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 347 of file blockassembler.cpp.
|
private |
Sort the package in an order that is valid to appear in a block.
Definition at line 355 of file blockassembler.cpp.
|
private |
Test if a new package would "fit" in the block.
Definition at line 275 of file blockassembler.cpp.
|
private |
Test if a set of transactions are all final.
Definition at line 286 of file blockassembler.cpp.
|
private |
Add descendants of given transactions to mapModifiedTx with ancestor state updated assuming given transactions are inBlock.
Definition at line 314 of file blockassembler.cpp.
|
private |
Definition at line 154 of file blockassembler.h.
|
private |
Definition at line 160 of file blockassembler.h.
|
private |
Definition at line 150 of file blockassembler.h.
|
private |
Definition at line 143 of file blockassembler.h.
|
private |
Definition at line 148 of file blockassembler.h.
|
private |
Definition at line 146 of file blockassembler.h.
|
private |
Definition at line 147 of file blockassembler.h.
|
private |
Definition at line 149 of file blockassembler.h.
|
private |
Definition at line 153 of file blockassembler.h.
|
private |
Definition at line 157 of file blockassembler.h.
|
private |
Definition at line 140 of file blockassembler.h.
|
private |
Definition at line 138 of file blockassembler.h.