From 1e1a23b5d8855747ebd362d16fc2b55e4f50e3bd Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Thu, 23 Jan 2014 19:25:08 -0200 Subject: [PATCH] fix GetNextInMainChain (thanks Pieter Wuille for suggesting this) --- src/main.h | 1 + 1 file changed, 1 insertion(+) 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]; }