diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 1d70612a1..18ad10cb0 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -222,24 +222,6 @@ void CChainParams::SetCheckpointData(CChainParams::CCheckpointData checkpointDat 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. class CTestNetParams : public CChainParams { public: @@ -490,16 +472,27 @@ void UpdateNetworkUpgradeParameters(Consensus::UpgradeIndex idx, int nActivation 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) { - // this codebase requires sapling activation at height=1 - 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); + return(_MAX_BLOCK_SIZE); } // Change the Hush blocktime at run-time(!) diff --git a/src/miner.cpp b/src/miner.cpp index ab5f8251c..466533ebb 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1321,8 +1321,7 @@ void static RandomXMiner() } CValidationState state; - { LOCK(cs_main); - + //{ LOCK(cs_main); if ( !TestBlockValidity(state,B, chainActive.LastTip(), true, false)) { h = UintToArith256(B.GetHash()); @@ -1333,8 +1332,7 @@ void static RandomXMiner() fprintf(stderr,"\n"); return(false); } - - } + //} SetThreadPriority(THREAD_PRIORITY_NORMAL); LogPrintf("HushRandomXMiner:\n"); LogPrintf("proof-of-work found \n hash: %s \ntarget: %s\n", B.GetHash().GetHex(), HASHTarget.GetHex()); @@ -1693,8 +1691,8 @@ void static BitcoinMiner() fprintf(stderr," mined %s block %d!\n",SMART_CHAIN_SYMBOL,Mining_height); } CValidationState state; - { LOCK(cs_main); + //{ LOCK(cs_main); if ( !TestBlockValidity(state,B, chainActive.LastTip(), true, false)) { h = UintToArith256(B.GetHash()); @@ -1705,7 +1703,7 @@ void static BitcoinMiner() return(false); } - } + //} HUSH_CHOSEN_ONE = 1; // Found a solution SetThreadPriority(THREAD_PRIORITY_NORMAL);