Fix zawy attack

This commit is contained in:
jl777
2019-07-31 19:02:44 -11:00
parent 074df8e0f3
commit 199d8db019
3 changed files with 5 additions and 7 deletions

View File

@@ -5288,7 +5288,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
}
// Check timestamp against prev
if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast())
if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast() + 2*ASSETCHAINS_ADAPTIVEPOW*ASSETCHAINS_BLOCKTIME )
{
return state.Invalid(error("%s: block's timestamp is too early", __func__),
REJECT_INVALID, "time-too-old");