From dbbdf7de87a1e5d1a9e7a3c76df9d0e0f317300a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 8 Apr 2018 18:57:56 +0300 Subject: [PATCH] Test --- src/komodo.h | 2 ++ src/main.cpp | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/komodo.h b/src/komodo.h index 0ff04b529..c9ee4142c 100644 --- a/src/komodo.h +++ b/src/komodo.h @@ -578,6 +578,8 @@ int32_t komodo_voutupdate(int32_t *isratificationp,int32_t notaryid,uint8_t *scr if ( (pindex= mapBlockIndex[srchash]) == 0 || pindex->nHeight != *notarizedheightp ) { fprintf(stderr,"FORK detected. notarized.%d %s no in this chain! REWIND to %d\n",*notarizedheightp,srchash.ToString().c_str(),sp->NOTARIZED_HEIGHT); + if ( sp->NOTARIZED_HEIGHT > 0 ) + KOMODO_REWIND = sp->NOTARIZED_HEIGHT - 1; } else validated = 1; if ( notarized != 0 && *notarizedheightp > sp->NOTARIZED_HEIGHT && *notarizedheightp < height && validated != 0 ) { diff --git a/src/main.cpp b/src/main.cpp index 4bfa9f122..4482cf4c6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3079,9 +3079,10 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo } if ( KOMODO_REWIND != 0 ) { - fprintf(stderr,"rewind start ht.%d\n",chainActive.Tip()->nHeight); + fprintf(stderr,">>>>>>>>>>> rewind start ht.%d\n",chainActive.Tip()->nHeight); while ( KOMODO_REWIND > 0 && chainActive.Tip()->nHeight > KOMODO_REWIND ) { + fprintf(stderr,"%d ",(int32_t)chainActive.Tip()->nHeight); if ( !DisconnectTip(state) ) { InvalidateBlock(state,chainActive.Tip()); @@ -3089,7 +3090,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo } } fprintf(stderr,"reached rewind.%d, best to do: ./komodo-cli stop\n",KOMODO_REWIND); - sleep(300); + sleep(60); KOMODO_REWIND = 0; return(true); }