From 80aa7891ecee9e46e4922b14ebb9916c6f0d7778 Mon Sep 17 00:00:00 2001 From: Warren Togami Date: Thu, 28 Nov 2013 13:33:26 -1000 Subject: [PATCH] Litecoin: Reduce prioritysize from 27KB to 17KB --- src/main.cpp | 6 +++--- src/main.h | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 71d5f43cc..9019708a6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -612,7 +612,7 @@ int64 CTransaction::GetMinFee(unsigned int nBlockSize, bool fAllowFree, else { // Free transaction area - if (nNewBlockSize < 27000) + if (nNewBlockSize < DEFAULT_BLOCK_PRIORITY_SIZE) nMinFee = 0; } } @@ -4215,13 +4215,13 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) pblocktemplate->vTxSigOps.push_back(-1); // updated at end // Largest block you're willing to create: - unsigned int nBlockMaxSize = GetArg("-blockmaxsize", MAX_BLOCK_SIZE_GEN/4); + unsigned int nBlockMaxSize = GetArg("-blockmaxsize", DEFAULT_BLOCK_MAX_SIZE); // Limit to betweeen 1K and MAX_BLOCK_SIZE-1K for sanity: nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize)); // How much of the block should be dedicated to high-priority transactions, // included regardless of the fees they pay - unsigned int nBlockPrioritySize = GetArg("-blockprioritysize", 27000); + unsigned int nBlockPrioritySize = GetArg("-blockprioritysize", DEFAULT_BLOCK_PRIORITY_SIZE); nBlockPrioritySize = std::min(nBlockMaxSize, nBlockPrioritySize); // Minimum block size you want to create; block will be filled with free transactions diff --git a/src/main.h b/src/main.h index 33cdd44b4..76ff622fe 100644 --- a/src/main.h +++ b/src/main.h @@ -27,10 +27,14 @@ struct CBlockIndexWorkComparator; /** The maximum allowed size for a serialized block, in bytes (network rule) */ static const unsigned int MAX_BLOCK_SIZE = 1000000; // 1000KB block hard limit -/** The maximum size for mined blocks */ +/** Obsolete: maximum size for mined blocks */ static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/4; // 250KB block soft limit +/** Default for -blockmaxsize, maximum size for mined blocks **/ +static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 250000; +/** Default for -blockprioritysize, maximum space for zero/low-fee transactions **/ +static const unsigned int DEFAULT_BLOCK_PRIORITY_SIZE = 17000; /** The maximum size for transactions we're willing to relay/mine */ -static const unsigned int MAX_STANDARD_TX_SIZE = MAX_BLOCK_SIZE_GEN/2.5; // 100KB tx size limit +static const unsigned int MAX_STANDARD_TX_SIZE = 100000; /** The maximum allowed number of signature check operations in a block (network rule) */ static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50; /** The maximum number of orphan transactions kept in memory */