Browse Source

Litecoin: DUST_SOFT_LIMIT=0.01, DUST_HARD_LIMIT=0.0001, 250KB block soft limit, 100KB tx size limit

0.8
Warren Togami 12 years ago
parent
commit
3ce5732926
  1. 8
      src/main.cpp
  2. 10
      src/main.h

8
src/main.cpp

@ -71,7 +71,7 @@ int64 nHPSTimerStart = 0; @@ -71,7 +71,7 @@ int64 nHPSTimerStart = 0;
// Settings
int64 nTransactionFee = 0;
int64 nMinimumInputValue = CENT / 100;
int64 nMinimumInputValue = DUST_HARD_LIMIT;
//////////////////////////////////////////////////////////////////////////////
@ -611,9 +611,9 @@ int64 CTransaction::GetMinFee(unsigned int nBlockSize, bool fAllowFree, @@ -611,9 +611,9 @@ int64 CTransaction::GetMinFee(unsigned int nBlockSize, bool fAllowFree,
}
// Litecoin
// To limit dust spam, add nBaseFee for each output less than 0.01
// To limit dust spam, add nBaseFee for each output less than DUST_SOFT_LIMIT
BOOST_FOREACH(const CTxOut& txout, vout)
if (txout.nValue < 0.01)
if (txout.nValue < DUST_SOFT_LIMIT)
nMinFee += nBaseFee;
// Raise the price as the block approaches full
@ -4143,7 +4143,7 @@ CBlockTemplate* CreateNewBlock(CReserveKey& reservekey) @@ -4143,7 +4143,7 @@ CBlockTemplate* CreateNewBlock(CReserveKey& reservekey)
pblocktemplate->vTxSigOps.push_back(-1); // updated at end
// Largest block you're willing to create:
unsigned int nBlockMaxSize = GetArg("-blockmaxsize", MAX_BLOCK_SIZE_GEN/2);
unsigned int nBlockMaxSize = GetArg("-blockmaxsize", MAX_BLOCK_SIZE_GEN/4);
// 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));

10
src/main.h

@ -26,11 +26,11 @@ class CNode; @@ -26,11 +26,11 @@ class CNode;
struct CBlockIndexWorkComparator;
/** The maximum allowed size for a serialized block, in bytes (network rule) */
static const unsigned int MAX_BLOCK_SIZE = 1000000;
static const unsigned int MAX_BLOCK_SIZE = 1000000; // 1000KB block hard limit
/** The maximum size for mined blocks */
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/4; // 250KB block soft limit
/** The maximum size for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_SIZE = MAX_BLOCK_SIZE_GEN/5;
static const unsigned int MAX_STANDARD_TX_SIZE = MAX_BLOCK_SIZE_GEN/2.5; // 100KB tx size limit
/** 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 */
@ -45,6 +45,10 @@ static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB @@ -45,6 +45,10 @@ static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
/** Fake height value used in CCoins to signify they are only in the memory pool (since 0.8) */
static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF;
/** Dust Soft Limit, allowed with additional fee per output */
static const int64 DUST_SOFT_LIMIT = 1000000; // 0.01 LTC
/** Dust Hard Limit, ignored as wallet inputs (mininput default) */
static const int64 DUST_HARD_LIMIT = 10000; // 0.0001 LTC mininput
/** No amount larger than this (in satoshi) is valid */
static const int64 MAX_MONEY = 84000000 * COIN;
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }

Loading…
Cancel
Save