Check for null index in FindFork
This commit is contained in:
@@ -51,6 +51,8 @@ CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const {
|
const CBlockIndex *CChain::FindFork(const CBlockIndex *pindex) const {
|
||||||
|
if ( pindex == 0 )
|
||||||
|
return(0);
|
||||||
if (pindex->nHeight > Height())
|
if (pindex->nHeight > Height())
|
||||||
pindex = pindex->GetAncestor(Height());
|
pindex = pindex->GetAncestor(Height());
|
||||||
while (pindex && !Contains(pindex))
|
while (pindex && !Contains(pindex))
|
||||||
|
|||||||
Reference in New Issue
Block a user