Browse Source

Single #define _MAX_BLOCK_SIZE to set max block size

pull/4/head
jl777 5 years ago
parent
commit
524342f7ba
  1. 2
      src/chainparams.cpp
  2. 3
      src/net.h
  3. 17
      src/util.h

2
src/chainparams.cpp

@ -229,7 +229,7 @@ int32_t MAX_BLOCK_SIZE(int32_t height) // make sure to change MAX_PROTOCOL_MESSA
{
//fprintf(stderr,"MAX_BLOCK_SIZE %d vs. %d\n",height,mainParams.consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight);
if ( height <= 0 || (mainParams.consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight > 0 && height >= mainParams.consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight) )
return(4096 * 1024);
return(_MAX_BLOCK_SIZE);
else return(2000000);
}

3
src/net.h

@ -33,6 +33,7 @@
#include "sync.h"
#include "uint256.h"
#include "utilstrencodings.h"
#include "util.h"
#include <deque>
#include <stdint.h>
@ -63,7 +64,7 @@ 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 = 4 * 1024 * 1024; // depends on MAX_BLOCK_SIZE
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = _MAX_BLOCK_SIZE;
/** Maximum length of strSubVer in `version` message */
static const unsigned int MAX_SUBVERSION_LENGTH = 256;
/** -listen default */

17
src/util.h

@ -3,6 +3,21 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
/******************************************************************************
* Copyright © 2014-2019 The SuperNET Developers. *
* *
* See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
* the top-level directory of this distribution for the individual copyright *
* holder information and the developer policies on copyright and licensing. *
* *
* Unless otherwise agreed in a custom licensing agreement, no part of the *
* SuperNET software, including this file may be copied, modified, propagated *
* or distributed except according to the terms contained in the LICENSE file *
* *
* Removal or modification of this copyright notice is prohibited. *
* *
******************************************************************************/
/**
* Server/client environment: argument handling, config file parsing,
* logging, thread wrappers
@ -29,6 +44,8 @@
#include <boost/signals2/signal.hpp>
#include <boost/thread/exceptions.hpp>
#define _MAX_BLOCK_SIZE (4096 * 1024) // changing just _MAX_BLOCK_SIZE will hardfork to that size
static const bool DEFAULT_LOGTIMEMICROS = false;
static const bool DEFAULT_LOGIPS = false;
static const bool DEFAULT_LOGTIMESTAMPS = true;

Loading…
Cancel
Save