summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/BitTorrent')
-rw-r--r--src/Network/BitTorrent/MainlineDHT.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Network/BitTorrent/MainlineDHT.hs b/src/Network/BitTorrent/MainlineDHT.hs
index 3e7a0eda..47d5b3e1 100644
--- a/src/Network/BitTorrent/MainlineDHT.hs
+++ b/src/Network/BitTorrent/MainlineDHT.hs
@@ -538,7 +538,12 @@ mkNodeInfo nid addr = NodeInfo
538 , nodePort = fromMaybe 0 $ sockAddrPort addr 538 , nodePort = fromMaybe 0 $ sockAddrPort addr
539 } 539 }
540 540
541newClient :: SwarmsDatabase -> SockAddr -> IO (MainlineClient, Routing) 541newClient :: SwarmsDatabase -> SockAddr
542 -> IO ( MainlineClient
543 , Routing
544 , [NodeInfo] -> [NodeInfo] -> IO ()
545 , [NodeInfo] -> [NodeInfo] -> IO ()
546 )
542newClient swarms addr = do 547newClient swarms addr = do
543 udp <- udpTransport addr 548 udp <- udpTransport addr
544 nid <- NodeId <$> getRandomBytes 20 549 nid <- NodeId <$> getRandomBytes 20
@@ -651,7 +656,7 @@ newClient swarms addr = do
651 refresh_thread4 <- forkPollForRefresh $ refresher4 routing 656 refresh_thread4 <- forkPollForRefresh $ refresher4 routing
652 refresh_thread6 <- forkPollForRefresh $ refresher6 routing 657 refresh_thread6 <- forkPollForRefresh $ refresher6 routing
653 658
654 return (client, routing) 659 return (client, routing, bootstrap (refresher4 routing), bootstrap (refresher6 routing))
655 660
656-- | Modifies a purely random 'NodeId' to one that is related to a given 661-- | Modifies a purely random 'NodeId' to one that is related to a given
657-- routable address in accordance with BEP 42. 662-- routable address in accordance with BEP 42.