Skip to content

Commit

Permalink
Fix nil number on stats report
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalank committed Apr 18, 2023
1 parent 84ec40c commit 1af9fb3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions quaistats/quaistats.go
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,9 @@ func (s *Service) reportPeers(conn *connWrapper) error {
downloaderPeer := peerInfo.Peer(peer.ID().String())
if downloaderPeer != nil {
hash, number, entropy, receivedAt := downloaderPeer.Peer().Head()
if number == nil {
number = big.NewInt(0)
}
peerStat.RTT = downloaderPeer.Tracker().Roundtrip().String()
peerStat.LatestHeight = number.Uint64()
peerStat.LatestEntropy = entropy.String()
Expand Down

0 comments on commit 1af9fb3

Please sign in to comment.