Grandfather logic

This commit is contained in:
jl777
2019-01-08 23:58:46 -11:00
parent f421590c81
commit 21ee92f6f3

View File

@@ -3181,11 +3181,13 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
//fprintf(stderr,"checkblock failure in connectblock futureblock.%d\n",futureblock);
return false;
}
fprintf(stderr,"connect.%d checkPOW.%d nTime.%u %d\n",pindex->GetHeight(),fCheckPOW,(uint32_t)pindex->nTime,ContextualCheckBlock(block, state, pindex->pprev));
if ( fCheckPOW != 0 && !ContextualCheckBlock(block, state, pindex->pprev) ) //&& pindex->nTime > 1547510400 Activate Jan 15th, 2019
//fprintf(stderr,"connect.%d checkPOW.%d nTime.%u %d\n",pindex->GetHeight(),fCheckPOW,(uint32_t)pindex->nTime,ContextualCheckBlock(block, state, pindex->pprev));
if ( fCheckPOW != 0 && !ContextualCheckBlock(block, state, pindex->pprev) ) // Activate Jan 15th, 2019
{
fprintf(stderr,"ContextualCheckBlock failed ht.%d\n",(int32_t)pindex->GetHeight());
return false;
if ( pindex->nTime > 1547510400 )
return false;
fprintf(stderr,"grandfathered exception, until jan 15th 2019\n");
}
// verify that the view's current state corresponds to the previous block
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();
@@ -5077,8 +5079,8 @@ bool AcceptBlock(int32_t *futureblockp,CBlock& block, CValidationState& state, C
// the problem is when a future sapling block comes in before we detected saplinght
if ( saplinght > 0 && (tmpptr= chainActive.LastTip()) != 0 )
{
fprintf(stderr,"saplinght.%d tipht.%d blockht.%d cmp.%d\n",saplinght,(int32_t)tmpptr->GetHeight(),pindex->GetHeight(),pindex->GetHeight() < 0 || (pindex->GetHeight() >= saplinght && pindex->GetHeight() < saplinght+10000) || (tmpptr->GetHeight() > saplinght-720 && tmpptr->GetHeight() < saplinght+720));
if ( pindex->GetHeight() < 0 || (pindex->GetHeight() >= saplinght && pindex->GetHeight() < saplinght+10000) || (tmpptr->GetHeight() > saplinght-720 && tmpptr->GetHeight() < saplinght+720) )
fprintf(stderr,"saplinght.%d tipht.%d blockht.%d cmp.%d\n",saplinght,(int32_t)tmpptr->GetHeight(),pindex->GetHeight(),pindex->GetHeight() < 0 || (pindex->GetHeight() >= saplinght && pindex->GetHeight() < saplinght+50000) || (tmpptr->GetHeight() > saplinght-720 && tmpptr->GetHeight() < saplinght+720));
if ( pindex->GetHeight() < 0 || (pindex->GetHeight() >= saplinght && pindex->GetHeight() < saplinght+50000) || (tmpptr->GetHeight() > saplinght-720 && tmpptr->GetHeight() < saplinght+720) )
*futureblockp = 1;
}
if ( *futureblockp == 0 )