@cryptotaxi247 / kubo / commits / 77cec5908

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

Jeromy committed Oct 10, 2014 at 05:41 UTC 77cec590833aab2c212c7fe0097abebc5ae1ecc1
2 files changed +6 -1
cmd/ipfs/ipfs.go
+1
@@ -59,6 +59,7 @@ Use "ipfs help <command>" for more information about a command.
59 cmdIpfsRun,
60 cmdIpfsName,
61 cmdIpfsBootstrap,
62 + cmdIpfsDiag,
63 },
64 Flag: *flag.NewFlagSet("ipfs", flag.ExitOnError),
65 }
peer/peer.go
+5 -1
@@ -105,6 +105,10 @@ func (p *Peer) GetLatency() (out time.Duration) {
105 // Yep, should be EWMA or something. (-jbenet)
106 func (p *Peer) SetLatency(laten time.Duration) {
107 p.Lock()
108 - p.latency = laten
108 + if p.latency == 0 {
109 + p.latency = laten
110 + } else {
111 + p.latency = ((p.latency * 9) + laten) / 10
112 + }
113 p.Unlock()
114 }