@cryptotaxi247 / kubo / commits / 796839971

clear dial backoff on explicit dial

License: MIT Signed-off-by: Jeromy <why@ipfs.io>

Jeromy committed Jul 4, 2016 at 12:27 UTC 7968399712a7176c5ef4c48e7ca1687d34f15be3
1 file changed +10
core/commands/swarm.go
+10
@@ -233,6 +233,14 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3
233 return
234 }
235
236 + snet, ok := n.PeerHost.Network().(*swarm.Network)
237 + if !ok {
238 + res.SetError(fmt.Errorf("peerhost network was not swarm"), cmds.ErrNormal)
239 + return
240 + }
241 +
242 + swrm := snet.Swarm()
243 +
244 pis, err := peersWithAddresses(addrs)
245 if err != nil {
246 res.SetError(err, cmds.ErrNormal)
@@ -241,6 +249,8 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3
249
250 output := make([]string, len(pis))
251 for i, pi := range pis {
252 + swrm.Backoff().Clear(pi.ID)
253 +
254 output[i] = "connect " + pi.ID.Pretty()
255
256 err := n.PeerHost.Connect(ctx, pi)