Changeset View
Changeset View
Standalone View
Standalone View
src/miner.h
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | private: | ||||
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; | |||||
uint8_t nBlockPriorityPercentage; | |||||
const Config *config; | |||||
const CTxMemPool *mempool; | const CTxMemPool *mempool; | ||||
// Variables used for addPriorityTxs | // Variables used for addPriorityTxs | ||||
int lastFewTxs; | int lastFewTxs; | ||||
public: | public: | ||||
BlockAssembler(const Config &_config, const CTxMemPool &mempool); | struct Options { | ||||
Options(); | |||||
uint64_t nExcessiveBlockSize; | |||||
uint64_t nMaxGeneratedBlockSize; | |||||
CFeeRate blockMinFeeRate; | |||||
uint8_t nBlockPriorityPercentage; | |||||
}; | |||||
BlockAssembler(const Config &config, const CTxMemPool &_mempool); | |||||
BlockAssembler(const CChainParams ¶ms, const CTxMemPool &_mempool, | |||||
const Options &options); | |||||
/** Construct a new block template with coinbase to scriptPubKeyIn */ | /** Construct a new block template with coinbase to scriptPubKeyIn */ | ||||
std::unique_ptr<CBlockTemplate> | std::unique_ptr<CBlockTemplate> | ||||
CreateNewBlock(const CScript &scriptPubKeyIn); | CreateNewBlock(const CScript &scriptPubKeyIn); | ||||
uint64_t GetMaxGeneratedBlockSize() const { return nMaxGeneratedBlockSize; } | uint64_t GetMaxGeneratedBlockSize() const { return nMaxGeneratedBlockSize; } | ||||
private: | private: | ||||
// utility functions | // utility functions | ||||
▲ Show 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | private: | ||||
* updated descendants. | * updated descendants. | ||||
*/ | */ | ||||
int UpdatePackagesForAdded(const CTxMemPool::setEntries &alreadyAdded, | int UpdatePackagesForAdded(const CTxMemPool::setEntries &alreadyAdded, | ||||
indexed_modified_transaction_set &mapModifiedTx) | indexed_modified_transaction_set &mapModifiedTx) | ||||
EXCLUSIVE_LOCKS_REQUIRED(mempool->cs); | EXCLUSIVE_LOCKS_REQUIRED(mempool->cs); | ||||
}; | }; | ||||
/** Modify the extranonce in a block */ | /** Modify the extranonce in a block */ | ||||
void IncrementExtraNonce(const Config &config, CBlock *pblock, | void IncrementExtraNonce(CBlock *pblock, const CBlockIndex *pindexPrev, | ||||
const CBlockIndex *pindexPrev, | uint64_t nExcessiveBlockSize, | ||||
unsigned int &nExtraNonce); | unsigned int &nExtraNonce); | ||||
int64_t UpdateTime(CBlockHeader *pblock, const Consensus::Params ¶ms, | int64_t UpdateTime(CBlockHeader *pblock, const Consensus::Params ¶ms, | ||||
const CBlockIndex *pindexPrev); | const CBlockIndex *pindexPrev); | ||||
#endif // BITCOIN_MINER_H | #endif // BITCOIN_MINER_H |