From: HAOYUatHZ Date: Tue, 27 Aug 2019 12:08:41 +0000 (+0800) Subject: fix height X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=commitdiff_plain;h=7fa21f78273c0c83f60015dce711ea91e98f9602;hp=f58fe84e9b29fc6409801ca66b75438eb7959f2d fix height --- 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 }