Make sure pindexWalk is non-null
This commit is contained in:
@@ -81,7 +81,8 @@ CBlockIndex* CBlockIndex::GetAncestor(int height)
|
||||
|
||||
CBlockIndex* pindexWalk = this;
|
||||
int heightWalk = nHeight;
|
||||
while (heightWalk > height) {
|
||||
while ( heightWalk > height && pindexWalk != 0 )
|
||||
{
|
||||
int heightSkip = GetSkipHeight(heightWalk);
|
||||
int heightSkipPrev = GetSkipHeight(heightWalk - 1);
|
||||
if (pindexWalk->pskip != NULL &&
|
||||
|
||||
Reference in New Issue
Block a user