Test
This commit is contained in:
15
src/main.cpp
15
src/main.cpp
@@ -2771,17 +2771,17 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
|
|||||||
}
|
}
|
||||||
if ( KOMODO_REWIND != 0 && chainActive.Tip()->nHeight >= KOMODO_REWIND )
|
if ( KOMODO_REWIND != 0 && chainActive.Tip()->nHeight >= KOMODO_REWIND )
|
||||||
{
|
{
|
||||||
//static int32_t didinit;
|
static int32_t didinit;
|
||||||
//if ( didinit++ == 0 )
|
|
||||||
if ( chainActive.Tip()->nHeight == KOMODO_REWIND )
|
if ( chainActive.Tip()->nHeight == KOMODO_REWIND )
|
||||||
{
|
{
|
||||||
pindexOldTip = pindexMostWork = chainActive.Tip();
|
pindexOldTip = pindexMostWork = chainActive.Tip();
|
||||||
fprintf(stderr,"reached rewind.%d, best to do: ./komodo-cli stop\n",KOMODO_REWIND);
|
fprintf(stderr,"reached rewind.%d, best to do: ./komodo-cli stop\n",KOMODO_REWIND);
|
||||||
pindexFork = chainActive.FindFork(pindexMostWork);
|
pindexFork = chainActive.FindFork(pindexMostWork);
|
||||||
KOMODO_REWIND = 0;
|
|
||||||
sleep(3);
|
sleep(3);
|
||||||
//return(false);
|
didinit++;
|
||||||
|
return(false);
|
||||||
}
|
}
|
||||||
|
if ( didinit == 0 )
|
||||||
{
|
{
|
||||||
while (chainActive.Tip()->nHeight > KOMODO_REWIND )
|
while (chainActive.Tip()->nHeight > KOMODO_REWIND )
|
||||||
{
|
{
|
||||||
@@ -2870,8 +2870,11 @@ bool ActivateBestChain(CValidationState &state, CBlock *pblock) {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!ActivateBestChainStep(state, pindexMostWork, pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : NULL))
|
if (!ActivateBestChainStep(state, pindexMostWork, pblock && pblock->GetHash() == pindexMostWork->GetBlockHash() ? pblock : NULL))
|
||||||
return false;
|
{
|
||||||
|
if ( KOMODO_REWIND == 0 )
|
||||||
|
return false;
|
||||||
|
fprintf(stderr,"ActivateBestChainStep rewind case\n");
|
||||||
|
}
|
||||||
pindexNewTip = chainActive.Tip();
|
pindexNewTip = chainActive.Tip();
|
||||||
fInitialDownload = IsInitialBlockDownload();
|
fInitialDownload = IsInitialBlockDownload();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user