diff --git a/src/main.cpp b/src/main.cpp index e01cba61f..67ba03d79 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -352,7 +352,9 @@ namespace { int GetHeight() { - return chainActive.LastTip()->GetHeight(); + if ( chainActive.LastTip() != 0 ) + return chainActive.LastTip()->GetHeight(); + else return(-1); } void UpdatePreferredDownload(CNode* node, CNodeState* state)