Check for null index in FindFork

This commit is contained in:
jl777
2018-01-07 18:06:14 +07:00
parent b91547118a
commit df473cc277

View File

@@ -51,6 +51,8 @@ CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const {
}
const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const {
if ( pindex == 0 )
return(0);
if (pindex->nHeight > Height())
pindex = pindex->GetAncestor(Height());
while (pindex && !Contains(pindex))