fix GetNextInMainChain (thanks Pieter Wuille for suggesting this)

This commit is contained in:
Miguel Freitas 2014-01-23 19:25:08 -02:00
parent b2a8e004ab
commit 1e1a23b5d8

View File

@ -751,6 +751,7 @@ public:
}
CBlockIndex *GetNextInMainChain() const {
if( !IsInMainChain() ) return NULL;
return nHeight+1 >= (int)vBlockIndexByHeight.size() ? NULL : vBlockIndexByHeight[nHeight+1];
}