From 3db0fd1d4811aaffe5021a62b3321444123a8e99 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 8 Nov 2018 07:40:32 -1100 Subject: [PATCH] Ignore <0 syncheight peers in longest chain calc --- src/rpcnet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index db6ffbc14..97bf5001d 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -179,6 +179,8 @@ int32_t komodo_longestchain() //fprintf(stderr,"komodo_longestchain iter.%d\n",n); CNodeStateStats statestats; bool fStateStats = GetNodeStateStats(stats.nodeid,statestats); + if ( statestats.nSyncHeight < 0 ) + continue; ht = 0; if ( stats.nStartingHeight > ht ) ht = stats.nStartingHeight; @@ -190,7 +192,6 @@ int32_t komodo_longestchain() maxheight = ht, num = 1; else if ( ht > maxheight*0.99 ) num++; - n++; if ( ht > height ) height = ht; }