From 1e80fc44ecb3bae39e531b9b932432e34d5242d9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 2 Jul 2019 01:39:12 -1100 Subject: [PATCH] Check null LastTip() --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)