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