diff options
author | joe <joe@jerkface.net> | 2018-06-22 21:17:22 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-06-22 21:17:22 -0400 |
commit | f5f854c8144dc29086928a94b2ea86cfae0d0557 (patch) | |
tree | 5a7daccc1be66375edd35b238f348129f540b146 /src/Network/Kademlia.hs | |
parent | 6f040764654640730d3f832cf4e41174562718fb (diff) |
Removed redundant imports and other clean up.
Diffstat (limited to 'src/Network/Kademlia.hs')
-rw-r--r-- | src/Network/Kademlia.hs | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/Network/Kademlia.hs b/src/Network/Kademlia.hs index 50c98967..44ef2ec1 100644 --- a/src/Network/Kademlia.hs +++ b/src/Network/Kademlia.hs | |||
@@ -6,11 +6,8 @@ | |||
6 | {-# LANGUAGE PatternSynonyms #-} | 6 | {-# LANGUAGE PatternSynonyms #-} |
7 | module Network.Kademlia where | 7 | module Network.Kademlia where |
8 | 8 | ||
9 | import Data.Function | ||
10 | import Data.Maybe | 9 | import Data.Maybe |
11 | import qualified Data.Set as Set | 10 | import Data.Time.Clock.POSIX |
12 | import Data.Time.Clock (getCurrentTime) | ||
13 | import Data.Time.Clock.POSIX (getPOSIXTime, utcTimeToPOSIXSeconds) | ||
14 | import Network.Kademlia.Routing as R | 11 | import Network.Kademlia.Routing as R |
15 | #ifdef THREAD_DEBUG | 12 | #ifdef THREAD_DEBUG |
16 | import Control.Concurrent.Lifted.Instrument | 13 | import Control.Concurrent.Lifted.Instrument |
@@ -20,24 +17,7 @@ import GHC.Conc (labelThread) | |||
20 | #endif | 17 | #endif |
21 | import Control.Concurrent.STM | 18 | import Control.Concurrent.STM |
22 | import Control.Monad | 19 | import Control.Monad |
23 | import Data.Bits | ||
24 | import Data.Hashable | ||
25 | #if MIN_VERSION_iproute(1,7,4) | ||
26 | import Data.IP hiding (fromSockAddr) | ||
27 | #else | ||
28 | import Data.IP | ||
29 | #endif | ||
30 | import Data.Monoid | ||
31 | import Data.Serialize (Serialize) | ||
32 | import Data.Time.Clock.POSIX (POSIXTime) | 20 | import Data.Time.Clock.POSIX (POSIXTime) |
33 | import Network.Address (bucketRange,genBucketSample) | ||
34 | import Network.Kademlia.Search | ||
35 | import System.Entropy | ||
36 | import System.Timeout | ||
37 | import Text.PrettyPrint as PP hiding (($$), (<>)) | ||
38 | import Text.PrettyPrint.HughesPJClass hiding (($$), (<>)) | ||
39 | import System.IO | ||
40 | import Control.Concurrent.Tasks | ||
41 | 21 | ||
42 | -- | The status of a given node with respect to a given routint table. | 22 | -- | The status of a given node with respect to a given routint table. |
43 | data RoutingStatus | 23 | data RoutingStatus |
@@ -147,7 +127,7 @@ accepted (_,y) = RoutingTransition y Accepted | |||
147 | insertNode :: Kademlia nid ni -> ni -> IO () | 127 | insertNode :: Kademlia nid ni -> ni -> IO () |
148 | insertNode (Kademlia reporter space io) node = do | 128 | insertNode (Kademlia reporter space io) node = do |
149 | 129 | ||
150 | tm <- utcTimeToPOSIXSeconds <$> getCurrentTime | 130 | tm <- getPOSIXTime |
151 | 131 | ||
152 | (ps,reaction) <- atomically $ do | 132 | (ps,reaction) <- atomically $ do |
153 | tbl <- tblRead io | 133 | tbl <- tblRead io |