Commit 477787c7 authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #3491 from ipfs/fix/swarm-peers-0-lat

swarm/peers: print 'n/a' instead of zero latency
parents 2aded678 4f78f405
...@@ -94,7 +94,12 @@ var swarmPeersCmd = &cmds.Command{ ...@@ -94,7 +94,12 @@ var swarmPeersCmd = &cmds.Command{
} }
if verbose || latency { if verbose || latency {
ci.Latency = n.Peerstore.LatencyEWMA(pid).String() lat := n.Peerstore.LatencyEWMA(pid)
if lat == 0 {
ci.Latency = "n/a"
} else {
ci.Latency = lat.String()
}
} }
if verbose || streams { if verbose || streams {
strs, err := c.GetStreams() strs, err := c.GetStreams()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment