Zawys new algo

1) FTL 4 seconds
2) MTP from 11 -> 1
3) must calc MAX(diff[I]) for past 11 blocks
4) bnTarget *= mult*mult
5) bnTarget.nBits -> onchain
This commit is contained in:
jl777
2019-08-01 09:14:07 -11:00
parent b6507d34de
commit 23ca86df3a
5 changed files with 51 additions and 24 deletions

View File

@@ -5043,7 +5043,15 @@ bool CheckBlockHeader(int32_t *futureblockp,int32_t height,CBlockIndex *pindex,
}
}
*futureblockp = 0;
if (blockhdr.GetBlockTime() > GetAdjustedTime() + 60)
if ( ASSETCHAINS_ADAPTIVEPOW > 0 )
{
if (blockhdr.GetBlockTime() > GetAdjustedTime() + 4)
{
//LogPrintf("CheckBlockHeader block from future %d error",blockhdr.GetBlockTime() - GetAdjustedTime());
return false;
}
}
else if (blockhdr.GetBlockTime() > GetAdjustedTime() + 60)
{
/*CBlockIndex *tipindex;
//fprintf(stderr,"ht.%d future block %u vs time.%u + 60\n",height,(uint32_t)blockhdr.GetBlockTime(),(uint32_t)GetAdjustedTime());
@@ -5288,7 +5296,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
}
// Check timestamp against prev
if ( ASSETCHAINS_ADAPTIVEPOW == 0 || nHeight < 3000 )
if ( ASSETCHAINS_ADAPTIVEPOW == 0 || nHeight < 30 )
{
if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast() )
{