main.cpp from dev

This commit is contained in:
jl777
2018-04-15 21:15:20 +03:00
parent edf5038441
commit 8d65568383

View File

@@ -3524,6 +3524,8 @@ int32_t komodo_reverify_blockcheck(CValidationState& state,int32_t height,CBlock
{ {
static int32_t oneshot; static int32_t oneshot;
CBlockIndex *tipindex; int32_t rewindtarget; CBlockIndex *tipindex; int32_t rewindtarget;
if ( KOMODO_REWIND != 0 )
oneshot = KOMODO_REWIND;
if ( oneshot == 0 && IsInitialBlockDownload() == 0 && (tipindex= chainActive.Tip()) != 0 ) if ( oneshot == 0 && IsInitialBlockDownload() == 0 && (tipindex= chainActive.Tip()) != 0 )
{ {
// if 200 blocks behind longestchain and no blocks for 2 hours // if 200 blocks behind longestchain and no blocks for 2 hours
@@ -3743,7 +3745,12 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
if ( pindex != 0 && pindex->nStatus & BLOCK_FAILED_MASK ) if ( pindex != 0 && pindex->nStatus & BLOCK_FAILED_MASK )
{ {
komodo_reverify_blockcheck(state,pindex->nHeight,pindex); komodo_reverify_blockcheck(state,pindex->nHeight,pindex);
if ( KOMODO_LONGESTCHAIN != 0 && pindex->nHeight > KOMODO_LONGESTCHAIN-100 )
return state.Invalid(error("%s: block is marked invalid", __func__), 0, "duplicate"); return state.Invalid(error("%s: block is marked invalid", __func__), 0, "duplicate");
else
{
pindex->nStatus &= ~BLOCK_FAILED_MASK;
}
} }
if ( pindex != 0 && IsInitialBlockDownload() == 0 ) // jl777 debug test if ( pindex != 0 && IsInitialBlockDownload() == 0 ) // jl777 debug test
{ {