summaryrefslogtreecommitdiff
path: root/src/Network
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2017-11-01 17:50:25 +0000
committerJames Crayne <jim.crayne@gmail.com>2017-11-01 17:50:25 +0000
commitaf3bb88ee1805d19264ff6f1e2c0874effac7d26 (patch)
tree0bb26766b520c805dd1427cb148b38270144e08b /src/Network
parent1766abbd8e4072fa47a82c09daceeb4235f3564d (diff)
parent9860107226e9e78c8ac82b287b4fb68262ee1c5b (diff)
Merge branch 'dht-rewrite' of jerkface.net:/home/jim/repo/bittorrent into dht-rewrite
Diffstat (limited to 'src/Network')
-rw-r--r--src/Network/Kademlia/Search.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Network/Kademlia/Search.hs b/src/Network/Kademlia/Search.hs
index 5f024cd0..9d51e815 100644
--- a/src/Network/Kademlia/Search.hs
+++ b/src/Network/Kademlia/Search.hs
@@ -105,7 +105,7 @@ reset :: (Ord ni, Ord nid, Hashable ni, Hashable nid) =>
105 -> Search nid addr1 tok1 ni r1 105 -> Search nid addr1 tok1 ni r1
106 -> nid 106 -> nid
107 -> SearchState nid addr tok ni r 107 -> SearchState nid addr tok ni r
108 -> STM () 108 -> STM (SearchState nid addr tok ni r)
109reset bkts qsearch target st = do 109reset bkts qsearch target st = do
110 searchIsFinished st >>= check -- Wait for a search to finish before resetting. 110 searchIsFinished st >>= check -- Wait for a search to finish before resetting.
111 bktNodes <- map (\ni -> ni :-> kademliaLocation (searchSpace qsearch) ni) 111 bktNodes <- map (\ni -> ni :-> kademliaLocation (searchSpace qsearch) ni)
@@ -116,6 +116,7 @@ reset bkts qsearch target st = do
116 writeTVar (searchInformant st) MM.empty 116 writeTVar (searchInformant st) MM.empty
117 writeTVar (searchVisited st) Set.empty 117 writeTVar (searchVisited st) Set.empty
118 writeTVar (searchPendingCount st) 0 118 writeTVar (searchPendingCount st) 0
119 return st
119 120
120searchAlpha :: Int 121searchAlpha :: Int
121searchAlpha = 8 122searchAlpha = 8