Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | BlockAssembler::BlockAssembler(const CChainParams ¶ms, | ||||
const Options &options) | const Options &options) | ||||
: chainParams(params), m_mempool(mempool) { | : chainParams(params), m_mempool(mempool) { | ||||
blockMinFeeRate = options.blockMinFeeRate; | blockMinFeeRate = options.blockMinFeeRate; | ||||
// Limit size to between 1K and options.nExcessiveBlockSize -1K for sanity: | // Limit size to between 1K and options.nExcessiveBlockSize -1K for sanity: | ||||
nMaxGeneratedBlockSize = std::max<uint64_t>( | nMaxGeneratedBlockSize = std::max<uint64_t>( | ||||
1000, std::min<uint64_t>(options.nExcessiveBlockSize - 1000, | 1000, std::min<uint64_t>(options.nExcessiveBlockSize - 1000, | ||||
options.nMaxGeneratedBlockSize)); | options.nMaxGeneratedBlockSize)); | ||||
// Calculate the max consensus sigchecks for this block. | // Calculate the max consensus sigchecks for this block. | ||||
auto nMaxBlockSigChecks = | auto nMaxBlockSigChecks = GetMaxBlockSigChecksCount(nMaxGeneratedBlockSize); | ||||
GetMaxBlockSigChecksCount(options.nExcessiveBlockSize); | |||||
// Allow the full amount of signature check operations in lieu of a separate | // Allow the full amount of signature check operations in lieu of a separate | ||||
// config option. (We are mining relayed transactions with validity cached | // config option. (We are mining relayed transactions with validity cached | ||||
// by everyone else, and so the block will propagate quickly, regardless of | // by everyone else, and so the block will propagate quickly, regardless of | ||||
// how many sigchecks it contains.) | // how many sigchecks it contains.) | ||||
nMaxGeneratedBlockSigChecks = nMaxBlockSigChecks; | nMaxGeneratedBlockSigChecks = nMaxBlockSigChecks; | ||||
} | } | ||||
static BlockAssembler::Options DefaultOptions(const Config &config) { | static BlockAssembler::Options DefaultOptions(const Config &config) { | ||||
▲ Show 20 Lines • Show All 498 Lines • Show Last 20 Lines |