mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-25 20:37:53 +08:00
swarm/peers: print 'n/a' instead of zero latency
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
This commit is contained in:
parent
b6c1155ac8
commit
4f78f40537
@ -94,7 +94,12 @@ var swarmPeersCmd = &cmds.Command{
|
||||
}
|
||||
|
||||
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 {
|
||||
strs, err := c.GetStreams()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user