Dip0001-related adjustments (inc. constants) (#1621)

* block size related constants adjusted; other minor fixes

* revert constants related to storing blocks on disk

* move AssertLockHeld to a separate PR
This commit is contained in:
Ilya Savinov 2017-09-14 14:42:37 +03:00 committed by UdjinM6
parent 5f4362cb82
commit 6a6b31b74d
3 changed files with 11 additions and 11 deletions

View File

@ -2557,7 +2557,7 @@ void CConnman::RecordBytesSent(uint64_t bytes)
void CConnman::SetMaxOutboundTarget(uint64_t limit)
{
LOCK(cs_totalBytesSent);
uint64_t recommendedMinimum = (nMaxOutboundTimeframe / 600) * MaxBlockSize(fDIP0001ActiveAtTip);
uint64_t recommendedMinimum = (nMaxOutboundTimeframe / 600) * MaxBlockSize(true);
nMaxOutboundLimit = limit;
if (limit > 0 && limit < recommendedMinimum)

View File

@ -55,8 +55,8 @@ static const int FEELER_INTERVAL = 120;
static const unsigned int MAX_INV_SZ = 50000;
/** The maximum number of new addresses to accumulate before announcing. */
static const unsigned int MAX_ADDR_TO_SEND = 1000;
/** Maximum length of incoming protocol messages (no message over 2 MiB is currently acceptable). */
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 2 * 1024 * 1024;
/** Maximum length of incoming protocol messages (no message over 3 MiB is currently acceptable). */
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 3 * 1024 * 1024;
/** Maximum length of strSubVer in `version` message */
static const unsigned int MAX_SUBVERSION_LENGTH = 256;
/** Maximum number of outgoing nodes */

View File

@ -186,15 +186,15 @@ static const unsigned int MIN_BLOCKS_TO_KEEP = 288;
static const signed int DEFAULT_CHECKBLOCKS = MIN_BLOCKS_TO_KEEP;
static const unsigned int DEFAULT_CHECKLEVEL = 3;
// Require that user allocate at least 550MB for block & undo files (blk???.dat and rev???.dat)
// At 1MB per block, 288 blocks = 288MB.
// Add 15% for Undo data = 331MB
// Add 20% for Orphan block rate = 397MB
// We want the low water mark after pruning to be at least 397 MB and since we prune in
// Require that user allocate at least 945MB for block & undo files (blk???.dat and rev???.dat)
// At 2MB per block, 288 blocks = 576MB.
// Add 15% for Undo data = 662MB
// Add 20% for Orphan block rate = 794MB
// We want the low water mark after pruning to be at least 794 MB and since we prune in
// full block file chunks, we need the high water mark which triggers the prune to be
// one 128MB block file + added 15% undo data = 147MB greater for a total of 545MB
// Setting the target to > than 550MB will make it likely we can respect the target.
static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024;
// one 128MB block file + added 15% undo data = 147MB greater for a total of 941MB
// Setting the target to > than 945MB will make it likely we can respect the target.
static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 945 * 1024 * 1024;
/**
* Process an incoming block. This only returns after the best known valid