summaryrefslogtreecommitdiff
path: root/src/Network/Kademlia
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-06-18 00:12:41 -0400
committerjoe <joe@jerkface.net>2018-06-18 00:12:41 -0400
commitdf618d4324af2ed6d0ca8c3c7da361989f31ba3b (patch)
tree16f83041a7bcd7e1607888d83a088666213f8930 /src/Network/Kademlia
parentbd8a498604fd976fee159d5b9d4a3582e769a5d5 (diff)
Limit pending search queries to 8 per search.
Diffstat (limited to 'src/Network/Kademlia')
-rw-r--r--src/Network/Kademlia/Search.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Network/Kademlia/Search.hs b/src/Network/Kademlia/Search.hs
index 593470c3..b7d07f7c 100644
--- a/src/Network/Kademlia/Search.hs
+++ b/src/Network/Kademlia/Search.hs
@@ -221,6 +221,7 @@ searchLoop sch@Search{..} target result s@SearchState{..} = do
221 withTaskGroup ("search.g."++show target) searchAlpha $ \g -> fix $ \again -> do 221 withTaskGroup ("search.g."++show target) searchAlpha $ \g -> fix $ \again -> do
222 join $ atomically $ do 222 join $ atomically $ do
223 cnt <- readTVar $ searchPendingCount 223 cnt <- readTVar $ searchPendingCount
224 check (cnt <= 8) -- Only 8 pending queries at a time.
224 informants <- readTVar searchInformant 225 informants <- readTVar searchInformant
225 found <- MM.minView <$> readTVar searchQueued 226 found <- MM.minView <$> readTVar searchQueued
226 case found of 227 case found of