Changeset View
Changeset View
Standalone View
Standalone View
src/miner.h
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | |||||
private: | private: | ||||
// The constructed block template | // The constructed block template | ||||
std::unique_ptr<CBlockTemplate> pblocktemplate; | std::unique_ptr<CBlockTemplate> pblocktemplate; | ||||
// A convenience pointer that always refers to the CBlock in pblocktemplate | // A convenience pointer that always refers to the CBlock in pblocktemplate | ||||
CBlock *pblock; | CBlock *pblock; | ||||
// Configuration parameters for the block size | // Configuration parameters for the block size | ||||
uint64_t nMaxGeneratedBlockSize; | uint64_t nMaxGeneratedBlockSize; | ||||
uint64_t nMaxGeneratedBlockSigChecks; | |||||
CFeeRate blockMinFeeRate; | CFeeRate blockMinFeeRate; | ||||
// Information on the current status of the block | // Information on the current status of the block | ||||
uint64_t nBlockSize; | uint64_t nBlockSize; | ||||
uint64_t nBlockTx; | uint64_t nBlockTx; | ||||
uint64_t nBlockSigOps; | uint64_t nBlockSigOps; | ||||
Amount nFees; | Amount nFees; | ||||
CTxMemPool::setEntries inBlock; | CTxMemPool::setEntries inBlock; | ||||
// Chain context for the block | // Chain context for the block | ||||
int nHeight; | int nHeight; | ||||
int64_t nLockTimeCutoff; | int64_t nLockTimeCutoff; | ||||
int64_t nMedianTimePast; | int64_t nMedianTimePast; | ||||
const CChainParams &chainparams; | const CChainParams &chainparams; | ||||
bool fUseSigChecks; | |||||
const CTxMemPool *mempool; | const CTxMemPool *mempool; | ||||
public: | public: | ||||
struct Options { | struct Options { | ||||
Options(); | Options(); | ||||
uint64_t nExcessiveBlockSize; | uint64_t nExcessiveBlockSize; | ||||
uint64_t nMaxGeneratedBlockSize; | uint64_t nMaxGeneratedBlockSize; | ||||
Show All 12 Lines | |||||
private: | private: | ||||
// utility functions | // utility functions | ||||
/** Clear the block's state and prepare for assembling a new block */ | /** Clear the block's state and prepare for assembling a new block */ | ||||
void resetBlock(); | void resetBlock(); | ||||
/** Add a tx to the block */ | /** Add a tx to the block */ | ||||
void AddToBlock(CTxMemPool::txiter iter); | void AddToBlock(CTxMemPool::txiter iter); | ||||
/** | |||||
* Calculate the "SigOps" limit for a given block size (may actually be the | |||||
* SigChecks limit which is independent of blockSize, depending on | |||||
* fUseSigChecks) | |||||
*/ | |||||
uint64_t MaxBlockSigOpsCountForSize(uint64_t blockSize) const; | |||||
// Methods for how to add transactions to a block. | // Methods for how to add transactions to a block. | ||||
/** | /** | ||||
* Add transactions based on feerate including unconfirmed ancestors. | * Add transactions based on feerate including unconfirmed ancestors. | ||||
* Increments nPackagesSelected / nDescendantsUpdated with corresponding | * Increments nPackagesSelected / nDescendantsUpdated with corresponding | ||||
* statistics from the package selection (for logging statistics). | * statistics from the package selection (for logging statistics). | ||||
*/ | */ | ||||
void addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated) | void addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated) | ||||
EXCLUSIVE_LOCKS_REQUIRED(mempool->cs); | EXCLUSIVE_LOCKS_REQUIRED(mempool->cs); | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |