aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
diff options
context:
space:
mode:
Diffstat (limited to 'p2p')
-rw-r--r--p2p/server.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/p2p/server.go b/p2p/server.go
index 5424b5463..16768f920 100644
--- a/p2p/server.go
+++ b/p2p/server.go
@@ -422,13 +422,13 @@ func (srv *Server) dialLoop() {
}
// Request a dial slot to prevent CPU exhaustion
<-slots
- defer func() { slots <- struct{}{} }()
dialing[dest.ID] = true
srv.peerWG.Add(1)
go func() {
srv.dialNode(dest)
dialed <- dest
+ slots <- struct{}{}
}()
}