Commit 29fef349 authored by Péter Szilágyi's avatar Péter Szilágyi

p2p: fix a dialing race in the throttler

parent 3953bf00
......@@ -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{}{}
}()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment