diff --git a/doc/release-notes.md b/doc/release-notes.md index 33cbbfd40..8fa2f9a74 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -52,6 +52,9 @@ We now use a new block template construction algorithm documented in "high priority" because they spent older inputs. The `-blockprioritysize` config option, which configured the portion of the block reserved for these transactions, has been removed and will now cause a warning if used. +- The `-blockminsize` option, which configured the size of a portion of the block + to be filled regardless of transaction fees or priority, has also been removed + and will cause a warning if used. Removal of Priority Estimation ------------------------------ diff --git a/qa/rpc-tests/show_help.py b/qa/rpc-tests/show_help.py index 9d20af6f7..1eb30cf90 100755 --- a/qa/rpc-tests/show_help.py +++ b/qa/rpc-tests/show_help.py @@ -399,9 +399,6 @@ Node relay options: Block creation options: - -blockminsize= - Set minimum block size in bytes (default: 0) - -blockmaxsize= Set maximum block size in bytes (default: 2000000) diff --git a/src/init.cpp b/src/init.cpp index c80ece182..270b2b239 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -500,7 +500,6 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-datacarriersize", strprintf(_("Maximum size of data in data carrier transactions we relay and mine (default: %u)"), MAX_OP_RETURN_RELAY)); strUsage += HelpMessageGroup(_("Block creation options:")); - strUsage += HelpMessageOpt("-blockminsize=", strprintf(_("Set minimum block size in bytes (default: %u)"), DEFAULT_BLOCK_MIN_SIZE)); strUsage += HelpMessageOpt("-blockmaxsize=", strprintf(_("Set maximum block size in bytes (default: %d)"), DEFAULT_BLOCK_MAX_SIZE)); if (GetBoolArg("-help-debug", false)) strUsage += HelpMessageOpt("-blockversion=", strprintf("Override block version to test forking scenarios (default: %d)", (int)CBlock::CURRENT_VERSION)); @@ -1292,6 +1291,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) } #endif + if (GetArg("-blockminsize", 0) != 0) { + InitWarning(_("The argument -blockminsize is no longer supported.")); + } + if (GetArg("-blockprioritysize", 0) != 0) { InitWarning(_("The argument -blockprioritysize is no longer supported.")); } diff --git a/src/miner.cpp b/src/miner.cpp index 405534f41..032079df0 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -339,11 +339,6 @@ BlockAssembler::BlockAssembler(const CChainParams& _chainparams) nBlockMaxSize = GetArg("-blockmaxsize", DEFAULT_BLOCK_MAX_SIZE); // Limit to between 1K and MAX_BLOCK_SIZE-1K for sanity: nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize)); - - // Minimum block size you want to create; block will be filled with free transactions - // until there are no more or the block reaches this size: - nBlockMinSize = GetArg("-blockminsize", DEFAULT_BLOCK_MIN_SIZE); - nBlockMinSize = std::min(nBlockMaxSize, nBlockMinSize); } void BlockAssembler::resetBlock(const MinerAddress& minerAddress) @@ -730,63 +725,6 @@ void BlockAssembler::addTransactions( } } -void BlockAssembler::addScoreTxs() -{ - std::priority_queue, ScoreCompare> clearedTxs; - CTxMemPool::setEntries waitSet; - CTxMemPool::indexed_transaction_set::index::type::iterator mi = mempool.mapTx.get().begin(); - CTxMemPool::txiter iter; - while (!blockFinished && (mi != mempool.mapTx.get().end() || !clearedTxs.empty())) - { - // If no txs that were previously postponed are available to try - // again, then try the next highest score tx - if (clearedTxs.empty()) { - iter = mempool.mapTx.project<0>(mi); - mi++; - } - // If a previously postponed tx is available to try again, then it - // has higher score than all untried so far txs - else { - iter = clearedTxs.top(); - clearedTxs.pop(); - } - - // If tx already in block, skip (added by addPriorityTxs) - if (inBlock.count(iter)) { - continue; - } - - // If tx is dependent on other mempool txs which haven't yet been included - // then put it in the waitSet - if (isStillDependent(iter)) { - waitSet.insert(iter); - continue; - } - - // If the fee rate is below the min fee rate for mining, then we're done - // adding txs based on score (fee rate) - if ((iter->GetModifiedFee() < ::minRelayTxFee.GetFee(iter->GetTxSize())) && - (iter->GetModifiedFee() < DEFAULT_FEE) && - (nBlockSize >= nBlockMinSize)) { - return; - } - - // If this tx fits in the block add it, otherwise keep looping - if (TestForBlock(iter)) { - AddToBlock(iter); - - // This tx was successfully added, so - // add transactions that depend on this one to the priority queue to try again - for (CTxMemPool::txiter child : mempool.GetMemPoolChildren(iter)) - { - if (waitSet.count(child)) { - clearedTxs.push(child); - waitSet.erase(child); - } - } - } - } -} ////////////////////////////////////////////////////////////////////////////// // diff --git a/src/miner.h b/src/miner.h index 08b8c210d..4ad6b0124 100644 --- a/src/miner.h +++ b/src/miner.h @@ -107,8 +107,8 @@ private: // A convenience pointer that always refers to the CBlock in pblocktemplate CBlock* pblock; - // Configuration parameters for the block size - unsigned int nBlockMaxSize, nBlockMinSize; + // Configuration parameter for the block size + unsigned int nBlockMaxSize; // Information on the current status of the block uint64_t nBlockSize; diff --git a/src/policy/policy.h b/src/policy/policy.h index a2feb15b1..2bf61c915 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -15,9 +15,8 @@ class CChainParams; class CCoinsViewCache; -/** Default for -blockmaxsize and -blockminsize, which control the range of sizes the mining code will create **/ +/** Default for -blockmaxsize, which controls the maximum block size the mining code will create **/ static const unsigned int DEFAULT_BLOCK_MAX_SIZE = MAX_BLOCK_SIZE; -static const unsigned int DEFAULT_BLOCK_MIN_SIZE = 0; /** Maximum number of signature check operations in an IsStandard() P2SH script */ static const unsigned int MAX_P2SH_SIGOPS = 15;