From 7fa21f78273c0c83f60015dce711ea91e98f9602 Mon Sep 17 00:00:00 2001 From: HAOYUatHZ Date: Tue, 27 Aug 2019 20:08:41 +0800 Subject: [PATCH] fix height --- toolbar/precog/monitor/stats.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolbar/precog/monitor/stats.go b/toolbar/precog/monitor/stats.go index 2162892d..b8b03c64 100644 --- a/toolbar/precog/monitor/stats.go +++ b/toolbar/precog/monitor/stats.go @@ -157,7 +157,9 @@ func (m *monitor) processPeerInfo(dbTx *gorm.DB, peerInfo *peers.PeerInfo) error } } ormNodeLiveness.PongTimes += 1 - ormNodeLiveness.BestHeight = peerInfo.Height + if peerInfo.Height != 0 { + ormNodeLiveness.BestHeight = peerInfo.Height + } if err := dbTx.Save(ormNodeLiveness).Error; err != nil { return err } -- 2.11.0