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

This commit is contained in:
Jeromy 2014-10-10 05:41:15 +00:00
parent d5f0476c1c
commit 77cec59083
2 changed files with 6 additions and 1 deletions

View File

@ -59,6 +59,7 @@ Use "ipfs help <command>" for more information about a command.
cmdIpfsRun,
cmdIpfsName,
cmdIpfsBootstrap,
cmdIpfsDiag,
},
Flag: *flag.NewFlagSet("ipfs", flag.ExitOnError),
}

View File

@ -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()
}