Skip to content

Commit

Permalink
Merge pull request #363 from jl777/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jl777 authored Mar 24, 2017
2 parents 816fac6 + 7d10671 commit aa17174
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2887,17 +2887,17 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
}
if ( KOMODO_REWIND != 0 )
{
fprintf(stderr,"rewind ht.%d\n",chainActive.Tip()->nHeight);
fprintf(stderr,"rewind start ht.%d\n",chainActive.Tip()->nHeight);
while ( chainActive.Tip()->nHeight > KOMODO_REWIND )
{
if ( !DisconnectTip(state) )
{
InvalidateBlock(state,chainActive.Tip());
return false;
break;
}
}
fprintf(stderr,"reached rewind.%d, best to do: ./komodo-cli stop\n",KOMODO_REWIND);
sleep(60);
sleep(3600);
KOMODO_REWIND = 0;
return(true);
}
Expand Down Expand Up @@ -3331,7 +3331,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat
BOOST_FOREACH(const CTransaction& tx, block.vtx)
{
uint32_t prevtime = 0; CBlockIndex *ptr;
if ( height == chainActive.Tip()->nHeight+1 )
if ( chainActive.Tip() != 0 && height == chainActive.Tip()->nHeight+1 )
prevtime = chainActive.Tip()->nTime;
else if ( pindex != 0 )
{
Expand All @@ -3340,7 +3340,7 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat
}
if ( prevtime == 0 )
{
if ( height > 0 && (ptr= chainActive[height-1]) )
if ( height > 0 && (ptr= chainActive[height-1]) != 0 )
prevtime = ptr->nTime;
}
if ( komodo_validate_interest(0,tx,height,prevtime) < 0 )
Expand Down

0 comments on commit aa17174

Please sign in to comment.