diff --git a/src/main.h b/src/main.h index 827aeabb..6a0d56e1 100644 --- a/src/main.h +++ b/src/main.h @@ -751,6 +751,7 @@ public: } CBlockIndex *GetNextInMainChain() const { + if( !IsInMainChain() ) return NULL; return nHeight+1 >= (int)vBlockIndexByHeight.size() ? NULL : vBlockIndexByHeight[nHeight+1]; }