提交 77cec590 作者: Jeromy

actually put diagCmd into the super command so it can be run

上级 d5f0476c
......@@ -59,6 +59,7 @@ Use "ipfs help <command>" for more information about a command.
cmdIpfsRun,
cmdIpfsName,
cmdIpfsBootstrap,
cmdIpfsDiag,
},
Flag: *flag.NewFlagSet("ipfs", flag.ExitOnError),
}
......
......@@ -105,6 +105,10 @@ func (p *Peer) GetLatency() (out time.Duration) {
// Yep, should be EWMA or something. (-jbenet)
func (p *Peer) SetLatency(laten time.Duration) {
p.Lock()
p.latency = laten
if p.latency == 0 {
p.latency = laten
} else {
p.latency = ((p.latency * 9) + laten) / 10
}
p.Unlock()
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论