Make sure activated before size change
This commit is contained in:
@@ -217,8 +217,8 @@ void CChainParams::SetCheckpointData(CChainParams::CCheckpointData checkpointDat
|
||||
|
||||
int32_t MAX_BLOCK_SIZE(int32_t height)
|
||||
{
|
||||
fprintf(stderr,"MAX_BLOCK_SIZE %d vs. %d\n",height,mainParams.consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight);
|
||||
if ( height >= mainParams.consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight )
|
||||
//fprintf(stderr,"MAX_BLOCK_SIZE %d vs. %d\n",height,mainParams.consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight);
|
||||
if ( mainParams.consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight > 0 && height >= mainParams.consensus.vUpgrades[Consensus::UPGRADE_SAPLING].nActivationHeight )
|
||||
return(4096 * 1024);
|
||||
else return(2000000);
|
||||
}
|
||||
|
||||
@@ -4648,6 +4648,7 @@ bool CheckBlock(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,const C
|
||||
// because we receive the wrong transactions for it.
|
||||
|
||||
// Size limits
|
||||
fprintf(stderr,"checkblock %d -> %d\n",height,MAX_BLOCK_SIZE(height));
|
||||
if (block.vtx.empty() || block.vtx.size() > MAX_BLOCK_SIZE(height) || ::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION) > MAX_BLOCK_SIZE(height))
|
||||
return state.DoS(100, error("CheckBlock: size limits failed"),
|
||||
REJECT_INVALID, "bad-blk-length");
|
||||
|
||||
Reference in New Issue
Block a user