diff options
author | Andrew Cady <d@jerkface.net> | 2018-06-19 12:51:02 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2018-06-19 12:51:02 -0400 |
commit | 12b585d1f712540f70a26095a8c13df554161c47 (patch) | |
tree | 49627d973d738482d6427e43bb88a646252036ed /src | |
parent | 365e2cb2dbcaae498df036df8b2a96284f9aecf2 (diff) |
move debug prints into Dput
Diffstat (limited to 'src')
-rw-r--r-- | src/Network/Kademlia/Bootstrap.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Network/Kademlia/Bootstrap.hs b/src/Network/Kademlia/Bootstrap.hs index 93cf08f3..bc8188a7 100644 --- a/src/Network/Kademlia/Bootstrap.hs +++ b/src/Network/Kademlia/Bootstrap.hs | |||
@@ -39,6 +39,7 @@ import System.Timeout | |||
39 | import Text.PrettyPrint as PP hiding (($$), (<>)) | 39 | import Text.PrettyPrint as PP hiding (($$), (<>)) |
40 | import Text.PrettyPrint.HughesPJClass hiding (($$), (<>)) | 40 | import Text.PrettyPrint.HughesPJClass hiding (($$), (<>)) |
41 | import System.IO | 41 | import System.IO |
42 | import DPut | ||
42 | 43 | ||
43 | import qualified Data.Wrapper.PSQInt as Int | 44 | import qualified Data.Wrapper.PSQInt as Int |
44 | ;import Data.Wrapper.PSQInt (pattern (:->)) | 45 | ;import Data.Wrapper.PSQInt (pattern (:->)) |
@@ -258,7 +259,7 @@ refreshBucket r@BucketRefresher{ refreshSearch = sch | |||
258 | _ <- timeout (15*60*1000000) $ do | 259 | _ <- timeout (15*60*1000000) $ do |
259 | atomically $ searchIsFinished s >>= check | 260 | atomically $ searchIsFinished s >>= check |
260 | atomically $ searchCancel s | 261 | atomically $ searchCancel s |
261 | hPutStrLn stderr $ "Finish refresh " ++ show (n,sample) | 262 | dput XDHT $ "Finish refresh " ++ show (n,sample) |
262 | now <- getPOSIXTime | 263 | now <- getPOSIXTime |
263 | join $ atomically $ onFinishedRefresh r n now | 264 | join $ atomically $ onFinishedRefresh r n now |
264 | rcount <- atomically $ do | 265 | rcount <- atomically $ do |
@@ -316,7 +317,7 @@ bootstrap r@BucketRefresher { refreshSearch = sch | |||
316 | forM_ ns0 $ \n -> do | 317 | forM_ ns0 $ \n -> do |
317 | forkTask g (show $ kademliaLocation (searchSpace sch) n) | 318 | forkTask g (show $ kademliaLocation (searchSpace sch) n) |
318 | (void $ ping n) | 319 | (void $ ping n) |
319 | hPutStrLn stderr "Finished bootstrap pings." | 320 | dput XDHT "Finished bootstrap pings." |
320 | -- Now search our own Id by entering bootstrap mode from non-bootstrap mode. | 321 | -- Now search our own Id by entering bootstrap mode from non-bootstrap mode. |
321 | join $ atomically $ do | 322 | join $ atomically $ do |
322 | writeTVar bootstrapMode False | 323 | writeTVar bootstrapMode False |