diff options
author | joe <joe@jerkface.net> | 2017-11-01 12:23:00 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-11-01 12:23:00 -0400 |
commit | 9860107226e9e78c8ac82b287b4fb68262ee1c5b (patch) | |
tree | 682ee314d57a18abd593d4e31713db3c4908f622 /src/Network/Kademlia | |
parent | 6880807978615fe52a28a1ca85134e4df68b9ac4 (diff) |
Functional "a" command.
Diffstat (limited to 'src/Network/Kademlia')
-rw-r--r-- | src/Network/Kademlia/Search.hs | 3 |
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) |
109 | reset bkts qsearch target st = do | 109 | reset 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 | ||
120 | searchAlpha :: Int | 121 | searchAlpha :: Int |
121 | searchAlpha = 8 | 122 | searchAlpha = 8 |