diff options
Diffstat (limited to 'Kademlia.hs')
-rw-r--r-- | Kademlia.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kademlia.hs b/Kademlia.hs index 017209a7..f256366f 100644 --- a/Kademlia.hs +++ b/Kademlia.hs | |||
@@ -8,7 +8,7 @@ module Kademlia where | |||
8 | 8 | ||
9 | import Data.Function | 9 | import Data.Function |
10 | import Data.Maybe | 10 | import Data.Maybe |
11 | import qualified Data.Set as Set | 11 | import qualified Data.Set as Set |
12 | import Data.Time.Clock (getCurrentTime) | 12 | import Data.Time.Clock (getCurrentTime) |
13 | import Data.Time.Clock.POSIX (getPOSIXTime, utcTimeToPOSIXSeconds) | 13 | import Data.Time.Clock.POSIX (getPOSIXTime, utcTimeToPOSIXSeconds) |
14 | import Network.DHT.Routing as R | 14 | import Network.DHT.Routing as R |
@@ -286,7 +286,7 @@ refreshBucket sch var n = do | |||
286 | tbl <- readTVar var | 286 | tbl <- readTVar var |
287 | let counts = R.shape tbl | 287 | let counts = R.shape tbl |
288 | when (n == R.bucketNumber (searchSpace sch) (kademliaLocation (searchSpace sch) found_node) tbl) | 288 | when (n == R.bucketNumber (searchSpace sch) (kademliaLocation (searchSpace sch) found_node) tbl) |
289 | $ modifyTVar resultCounter (Set.insert found_node) | 289 | $ modifyTVar' resultCounter (Set.insert found_node) |
290 | resultCount <- readTVar resultCounter | 290 | resultCount <- readTVar resultCounter |
291 | saveit $ case drop (n - 1) counts of | 291 | saveit $ case drop (n - 1) counts of |
292 | (cnt:_) | cnt < fullcount -> True | 292 | (cnt:_) | cnt < fullcount -> True |