From 4f64b197d20152e387b66b528f18dcb57d009dee Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 31 Jul 2019 19:32:41 -1100 Subject: [PATCH] Fix --- src/main.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d83f5f169..8505b974b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5288,10 +5288,21 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta } // Check timestamp against prev - if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast() + 2*ASSETCHAINS_ADAPTIVEPOW*ASSETCHAINS_BLOCKTIME ) + if ( ASSETCHAINS_ADAPTIVEPOW == 0 || nHeight < 1000 ) { - return state.Invalid(error("%s: block's timestamp is too early", __func__), - REJECT_INVALID, "time-too-old"); + if (block.GetBlockTime() <= pindexPrev->GetMedianTimePast() ) + { + return state.Invalid(error("%s: block's timestamp is too early", __func__), + REJECT_INVALID, "time-too-old"); + } + } + else + { + if ( block.GetBlockTime() <= pindexPrev->GetMedianTimePast() + 2*ASSETCHAINS_ADAPTIVEPOW*ASSETCHAINS_BLOCKTIME ) + { + return state.Invalid(error("%s: block's timestamp is too early2", __func__), + REJECT_INVALID, "time-too-old"); + } } // Check that timestamp is not too far in the future