Ignore <0 syncheight peers in longest chain calc
This commit is contained in:
@@ -179,6 +179,8 @@ int32_t komodo_longestchain()
|
|||||||
//fprintf(stderr,"komodo_longestchain iter.%d\n",n);
|
//fprintf(stderr,"komodo_longestchain iter.%d\n",n);
|
||||||
CNodeStateStats statestats;
|
CNodeStateStats statestats;
|
||||||
bool fStateStats = GetNodeStateStats(stats.nodeid,statestats);
|
bool fStateStats = GetNodeStateStats(stats.nodeid,statestats);
|
||||||
|
if ( statestats.nSyncHeight < 0 )
|
||||||
|
continue;
|
||||||
ht = 0;
|
ht = 0;
|
||||||
if ( stats.nStartingHeight > ht )
|
if ( stats.nStartingHeight > ht )
|
||||||
ht = stats.nStartingHeight;
|
ht = stats.nStartingHeight;
|
||||||
@@ -190,7 +192,6 @@ int32_t komodo_longestchain()
|
|||||||
maxheight = ht, num = 1;
|
maxheight = ht, num = 1;
|
||||||
else if ( ht > maxheight*0.99 )
|
else if ( ht > maxheight*0.99 )
|
||||||
num++;
|
num++;
|
||||||
n++;
|
|
||||||
if ( ht > height )
|
if ( ht > height )
|
||||||
height = ht;
|
height = ht;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user