From 9860107226e9e78c8ac82b287b4fb68262ee1c5b Mon Sep 17 00:00:00 2001 From: joe Date: Wed, 1 Nov 2017 12:23:00 -0400 Subject: Functional "a" command. --- src/Network/Kademlia/Search.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Network') 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) => -> Search nid addr1 tok1 ni r1 -> nid -> SearchState nid addr tok ni r - -> STM () + -> STM (SearchState nid addr tok ni r) reset bkts qsearch target st = do searchIsFinished st >>= check -- Wait for a search to finish before resetting. bktNodes <- map (\ni -> ni :-> kademliaLocation (searchSpace qsearch) ni) @@ -116,6 +116,7 @@ reset bkts qsearch target st = do writeTVar (searchInformant st) MM.empty writeTVar (searchVisited st) Set.empty writeTVar (searchPendingCount st) 0 + return st searchAlpha :: Int searchAlpha = 8 -- cgit v1.2.3