Fix zawy attack, thanks zawy!

This commit is contained in:
jl777
2019-08-01 00:38:59 -11:00
parent a74bd537a4
commit 1cefd54af1
2 changed files with 12 additions and 5 deletions

View File

@@ -5299,9 +5299,9 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
}
else
{
if ( block.GetBlockTime() <= pindexPrev->GetMedianTimePast() + 2*ASSETCHAINS_ADAPTIVEPOW*ASSETCHAINS_BLOCKTIME )
if ( block.GetBlockTime() <= pindexPrev->nTime )
{
fprintf(stderr,"ht.%d too early2 %u vs %u\n",(int32_t)nHeight,(uint32_t)block.GetBlockTime(),(uint32_t)pindexPrev->GetMedianTimePast());
fprintf(stderr,"ht.%d too early2 %u vs %u\n",(int32_t)nHeight,(uint32_t)block.GetBlockTime(),(uint32_t)pindexPrev->nTime);
return state.Invalid(error("%s: block's timestamp is too early2", __func__),
REJECT_INVALID, "time-too-old");
}