summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/DHT.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent/DHT.hs')
-rw-r--r--src/Network/BitTorrent/DHT.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Network/BitTorrent/DHT.hs b/src/Network/BitTorrent/DHT.hs
index 5517e20f..a098d339 100644
--- a/src/Network/BitTorrent/DHT.hs
+++ b/src/Network/BitTorrent/DHT.hs
@@ -91,7 +91,8 @@ dht = runDHT handlers
91{-# INLINE dht #-} 91{-# INLINE dht #-}
92 92
93-- | One good node may be sufficient. The list of bootstrapping nodes 93-- | One good node may be sufficient. The list of bootstrapping nodes
94-- usually obtained from 'Data.Torrent.tNodes' field. 94-- usually obtained from 'Data.Torrent.tNodes' field. Bootstrapping
95-- process can take up to 5 minutes.
95-- 96--
96-- (TODO) This operation is asynchronous and do not block. 97-- (TODO) This operation is asynchronous and do not block.
97-- 98--
@@ -109,12 +110,12 @@ bootstrap startNodes = do
109 $(logWarnS) "bootstrap" $ T.pack $ show (e :: IOError) 110 $(logWarnS) "bootstrap" $ T.pack $ show (e :: IOError)
110 111
111 Right (NodeFound closest) -> do 112 Right (NodeFound closest) -> do
112 $(logDebug) ("Get a list of closest nodes: " <> 113 $(logDebug) $ "Get a list of closest nodes: " <>
113 T.pack (PP.render (pretty closest))) 114 T.pack (PP.render (pretty closest))
114 forM_ (L.take 2 closest) $ \ info @ NodeInfo {..} -> do 115 forM_ closest $ \ info @ NodeInfo {..} -> do
115 let prettyAddr = T.pack (show (pretty nodeAddr)) 116 let prettyAddr = T.pack (show (pretty nodeAddr))
116 $(logInfoS) "bootstrap" $ "table detalization" <> prettyAddr 117 $(logInfoS) "bootstrap" $ "table detalization" <> prettyAddr
117 fork $ insertClosest nodeAddr 118 insertClosest nodeAddr
118 119
119-- | Get list of peers which downloading this torrent. 120-- | Get list of peers which downloading this torrent.
120-- 121--