Cleanup MAX_BLOCK_SIZE
This commit is contained in:
@@ -222,24 +222,6 @@ void CChainParams::SetCheckpointData(CChainParams::CCheckpointData checkpointDat
|
|||||||
CChainParams::checkpointData = checkpointData;
|
CChainParams::checkpointData = checkpointData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
To change the max block size, all that needs to be updated is the #define _MAX_BLOCK_SIZE in utils.h
|
|
||||||
|
|
||||||
However, doing that without any other changes will allow forking non-updated nodes by creating a larger block. So, make sure to height activate the new blocksize properly.
|
|
||||||
|
|
||||||
Assuming it is 8MB, then:
|
|
||||||
#define _OLD_MAX_BLOCK_SIZE (4096 * 1024)
|
|
||||||
#define _MAX_BLOCK_SIZE (2 * 4096 * 1024)
|
|
||||||
|
|
||||||
change the body of if:
|
|
||||||
{
|
|
||||||
if ( height < saplinght+1000000 ) // activates 8MB blocks 1 million blocks after saplinght
|
|
||||||
return(_OLD_MAX_BLOCK_SIZE);
|
|
||||||
else return(_MAX_BLOCK_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Unused Testnet, for completeness. We make testcoins instead.
|
// Unused Testnet, for completeness. We make testcoins instead.
|
||||||
class CTestNetParams : public CChainParams {
|
class CTestNetParams : public CChainParams {
|
||||||
public:
|
public:
|
||||||
@@ -490,16 +472,27 @@ void UpdateNetworkUpgradeParameters(Consensus::UpgradeIndex idx, int nActivation
|
|||||||
regTestParams.UpdateNetworkUpgradeParameters(idx, nActivationHeight);
|
regTestParams.UpdateNetworkUpgradeParameters(idx, nActivationHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
To change the max block size, all that needs to be updated is the #define _MAX_BLOCK_SIZE in utils.h
|
||||||
|
|
||||||
|
However, doing that without any other changes will allow forking non-updated nodes by creating a larger block. So, make sure to height activate the new blocksize properly.
|
||||||
|
|
||||||
|
Assuming it is 8MB, then:
|
||||||
|
#define _OLD_MAX_BLOCK_SIZE (4096 * 1024)
|
||||||
|
#define _MAX_BLOCK_SIZE (2 * 4096 * 1024)
|
||||||
|
|
||||||
|
change the body of MAX_BLOCK_SIZE() function to
|
||||||
|
{
|
||||||
|
if ( height < saplinght+1000000 ) // activates 8MB blocks 1 million blocks after saplinght
|
||||||
|
return(_OLD_MAX_BLOCK_SIZE);
|
||||||
|
else return(_MAX_BLOCK_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
int32_t MAX_BLOCK_SIZE(int32_t height)
|
int32_t MAX_BLOCK_SIZE(int32_t height)
|
||||||
{
|
{
|
||||||
// this codebase requires sapling activation at height=1
|
return(_MAX_BLOCK_SIZE);
|
||||||
int32_t saplinght = 1; // pCurrentParams->consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight;
|
|
||||||
//fprintf(stderr,"MAX_BLOCK_SIZE %d vs. %d\n",height,mainParams.consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight);
|
|
||||||
//if ( height <= 0 || (saplinght > 0 && height >= saplinght) )
|
|
||||||
//{
|
|
||||||
return(_MAX_BLOCK_SIZE);
|
|
||||||
//}
|
|
||||||
//else return(2000000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change the Hush blocktime at run-time(!)
|
// Change the Hush blocktime at run-time(!)
|
||||||
|
|||||||
Reference in New Issue
Block a user