Skip to content

Commit 6543591

Browse files
committed
Use better calculation for top block
1 parent 059fde0 commit 6543591

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

netsync/manager.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,12 @@ func (sm *SyncManager) medianSyncPeerCandidateBlockHeight() int32 {
571571
continue
572572
}
573573

574-
heights = append(heights, peer.LastBlock())
574+
topBlock := peer.LastBlock()
575+
if topBlock < peer.StartingHeight() {
576+
topBlock = peer.StartingHeight()
577+
}
578+
579+
heights = append(heights, topBlock)
575580
}
576581

577582
// If we don't have any sync peer candidate heights, return 0.

0 commit comments

Comments
 (0)