diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-04-30 20:21:09 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-05-07 20:22:08 +0800 |
commit | 29fef349efd87dcca76b0593e6b68ca9f3ccf2cd (patch) | |
tree | 560f5f506dac2d264814a7f61544675102ca1b1f /p2p | |
parent | 3953bf0031b6b2a4302b333aa65fc8ccaa7d788c (diff) | |
download | dexon-29fef349efd87dcca76b0593e6b68ca9f3ccf2cd.tar dexon-29fef349efd87dcca76b0593e6b68ca9f3ccf2cd.tar.gz dexon-29fef349efd87dcca76b0593e6b68ca9f3ccf2cd.tar.bz2 dexon-29fef349efd87dcca76b0593e6b68ca9f3ccf2cd.tar.lz dexon-29fef349efd87dcca76b0593e6b68ca9f3ccf2cd.tar.xz dexon-29fef349efd87dcca76b0593e6b68ca9f3ccf2cd.tar.zst dexon-29fef349efd87dcca76b0593e6b68ca9f3ccf2cd.zip |
p2p: fix a dialing race in the throttler
Diffstat (limited to 'p2p')
-rw-r--r-- | p2p/server.go | 2 |
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{}{} }() } |