This commit is contained in:
jl777
2018-04-16 09:55:38 +03:00
parent d3e5f6b7c3
commit 9226f69ef1

View File

@@ -3407,6 +3407,8 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
*ppindex = pindex; *ppindex = pindex;
if (pindex != 0 && pindex->nStatus & BLOCK_FAILED_MASK) if (pindex != 0 && pindex->nStatus & BLOCK_FAILED_MASK)
return state.Invalid(error("%s: block is marked invalid", __func__), 0, "duplicate"); return state.Invalid(error("%s: block is marked invalid", __func__), 0, "duplicate");
if ( *ppindex == 0 )
fprintf(stderr,"acceptblockheader returns null ptr\n");
return true; return true;
} }
@@ -3426,7 +3428,10 @@ bool AcceptBlockHeader(const CBlockHeader& block, CValidationState& state, CBloc
if (!ContextualCheckBlockHeader(block, state, pindexPrev)) if (!ContextualCheckBlockHeader(block, state, pindexPrev))
return false; return false;
if (pindex == NULL) if (pindex == NULL)
pindex = AddToBlockIndex(block); {
if ( (pindex= AddToBlockIndex(block)) == 0 )
fprintf(stderr,"addtoblockindex failed\n");
}
if (ppindex) if (ppindex)
*ppindex = pindex; *ppindex = pindex;
return true; return true;