summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-11-01 12:23:00 -0400
committerjoe <joe@jerkface.net>2017-11-01 12:23:00 -0400
commit9860107226e9e78c8ac82b287b4fb68262ee1c5b (patch)
tree682ee314d57a18abd593d4e31713db3c4908f622 /src
parent6880807978615fe52a28a1ca85134e4df68b9ac4 (diff)
Functional "a" command.
Diffstat (limited to 'src')
-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