From 4e4e39abfbded1855f35d25837ab84713c0a3d21 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 24 Mar 2017 04:35:23 +0200 Subject: [PATCH 1/3] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 2616947621b..1d43f358135 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 ) { @@ -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 ) From 45142781ececa0a22000ebd9292cd4da9e9c62c5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 24 Mar 2017 04:37:21 +0200 Subject: [PATCH 2/3] Test --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 1d43f358135..58d26f9cc88 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2893,7 +2893,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo if ( !DisconnectTip(state) ) { InvalidateBlock(state,chainActive.Tip()); - return false; + break; } } fprintf(stderr,"reached rewind.%d, best to do: ./komodo-cli stop\n",KOMODO_REWIND); From 7d1067177e59be3ee1a8bd3786581208d12300ec Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 24 Mar 2017 04:39:52 +0200 Subject: [PATCH 3/3] Test --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 58d26f9cc88..228f0abcbd0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2887,7 +2887,7 @@ 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) ) @@ -2897,7 +2897,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo } } fprintf(stderr,"reached rewind.%d, best to do: ./komodo-cli stop\n",KOMODO_REWIND); - sleep(60); + sleep(3600); KOMODO_REWIND = 0; return(true); }