Changeset View
Changeset View
Standalone View
Standalone View
src/miner.cpp
Show First 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | static uint64_t ComputeMaxGeneratedBlockSize(const Config &config, | ||||
// Limit size to between 1K and MaxBlockSize-1K for sanity: | // Limit size to between 1K and MaxBlockSize-1K for sanity: | ||||
nMaxGeneratedBlockSize = | nMaxGeneratedBlockSize = | ||||
std::max(uint64_t(1000), std::min(config.GetMaxBlockSize() - 1000, | std::max(uint64_t(1000), std::min(config.GetMaxBlockSize() - 1000, | ||||
nMaxGeneratedBlockSize)); | nMaxGeneratedBlockSize)); | ||||
return nMaxGeneratedBlockSize; | return nMaxGeneratedBlockSize; | ||||
} | } | ||||
BlockAssembler::BlockAssembler(const Config &_config, const CTxMemPool &mpool) | BlockAssembler::BlockAssembler(const Config &config, const CTxMemPool &mpool) | ||||
: config(&_config), mempool(&mpool) { | : mempool(&mpool) { | ||||
if (gArgs.IsArgSet("-blockmintxfee")) { | if (gArgs.IsArgSet("-blockmintxfee")) { | ||||
Amount n = Amount::zero(); | Amount n = Amount::zero(); | ||||
ParseMoney(gArgs.GetArg("-blockmintxfee", ""), n); | ParseMoney(gArgs.GetArg("-blockmintxfee", ""), n); | ||||
blockMinFeeRate = CFeeRate(n); | blockMinFeeRate = CFeeRate(n); | ||||
} else { | } else { | ||||
blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE_PER_KB); | blockMinFeeRate = CFeeRate(DEFAULT_BLOCK_MIN_TX_FEE_PER_KB); | ||||
} | } | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
nMaxGeneratedBlockSize = | nMaxGeneratedBlockSize = | ||||
ComputeMaxGeneratedBlockSize(*config, chainActive.Tip()); | ComputeMaxGeneratedBlockSize(config, chainActive.Tip()); | ||||
} | } | ||||
void BlockAssembler::resetBlock() { | void BlockAssembler::resetBlock() { | ||||
inBlock.clear(); | inBlock.clear(); | ||||
// Reserve space for coinbase tx. | // Reserve space for coinbase tx. | ||||
nBlockSize = 1000; | nBlockSize = 1000; | ||||
nBlockSigOps = 100; | nBlockSigOps = 100; | ||||
▲ Show 20 Lines • Show All 610 Lines • Show Last 20 Lines |