From 6afe616f4d024a6c6064444068d119761b75055a Mon Sep 17 00:00:00 2001 From: sukun Date: Thu, 20 Apr 2023 19:10:17 +0530 Subject: [PATCH] swarm: remove unused variable in addrDial --- p2p/net/swarm/dial_worker.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/p2p/net/swarm/dial_worker.go b/p2p/net/swarm/dial_worker.go index ff339d2f2b..f805371cc6 100644 --- a/p2p/net/swarm/dial_worker.go +++ b/p2p/net/swarm/dial_worker.go @@ -38,7 +38,6 @@ type addrDial struct { conn *Conn err error requests []int - dialed bool } type dialWorker struct { @@ -155,11 +154,9 @@ loop: w.requests[w.reqno] = pr for _, ad := range tojoin { - if !ad.dialed { - if simConnect, isClient, reason := network.GetSimultaneousConnect(req.ctx); simConnect { - if simConnect, _, _ := network.GetSimultaneousConnect(ad.ctx); !simConnect { - ad.ctx = network.WithSimultaneousConnect(ad.ctx, isClient, reason) - } + if simConnect, isClient, reason := network.GetSimultaneousConnect(req.ctx); simConnect { + if simConnect, _, _ := network.GetSimultaneousConnect(ad.ctx); !simConnect { + ad.ctx = network.WithSimultaneousConnect(ad.ctx, isClient, reason) } } ad.requests = append(ad.requests, w.reqno)