diff --git a/src/init.cpp b/src/init.cpp --- a/src/init.cpp +++ b/src/init.cpp @@ -789,7 +789,8 @@ HelpMessageOpt("-blockprioritysize=", strprintf(_("Set maximum size of high-priority/low-fee " "transactions in bytes (default: %d)"), - DEFAULT_BLOCK_PRIORITY_SIZE)); + DEFAULT_BLOCK_PRIORITY_SIZE_PER_MB * + DEFAULT_MAX_BLOCK_SIZE / ONE_MEGABYTE)); strUsage += HelpMessageOpt( "-blockmintxfee=", strprintf(_("Set lowest fee rate (in %s/kB) for transactions to be " diff --git a/src/miner.cpp b/src/miner.cpp --- a/src/miner.cpp +++ b/src/miner.cpp @@ -562,7 +562,8 @@ // How much of the block should be dedicated to high-priority transactions, // included regardless of the fees they pay. uint64_t nBlockPrioritySize = - GetArg("-blockprioritysize", DEFAULT_BLOCK_PRIORITY_SIZE); + GetArg("-blockprioritysize", DEFAULT_BLOCK_PRIORITY_SIZE_PER_MB * + DEFAULT_MAX_BLOCK_SIZE / ONE_MEGABYTE); nBlockPrioritySize = std::min(nMaxGeneratedBlockSize, nBlockPrioritySize); if (nBlockPrioritySize == 0) { return; diff --git a/src/policy/policy.h b/src/policy/policy.h --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -19,7 +19,7 @@ static const uint64_t DEFAULT_MAX_GENERATED_BLOCK_SIZE = 2 * ONE_MEGABYTE; /** Default for -blockprioritysize, maximum space for zero/low-fee transactions * **/ -static const uint64_t DEFAULT_BLOCK_PRIORITY_SIZE = 0; +static const uint64_t DEFAULT_BLOCK_PRIORITY_SIZE_PER_MB = 5000; /** Default for -blockmintxfee, which sets the minimum feerate for a transaction * in blocks created by mining code **/ static const unsigned int DEFAULT_BLOCK_MIN_TX_FEE = 1000; diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -86,6 +86,9 @@ GlobalConfig config; + // these 3 tests assume blockprioritysize is 0. + ForceSetArg("-blockprioritysize", "0"); + // Test that a medium fee transaction will be selected after a higher fee // rate package with a low fee rate parent. CMutableTransaction tx;