From 61619558b26b96048ffd18a7bf4cbe41d5fffa2f Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Thu, 2 Jan 2014 22:37:33 +0400 Subject: Stop bootstrapping when table is full --- src/Network/BitTorrent/DHT.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Network/BitTorrent/DHT.hs') diff --git a/src/Network/BitTorrent/DHT.hs b/src/Network/BitTorrent/DHT.hs index a098d339..38de1f91 100644 --- a/src/Network/BitTorrent/DHT.hs +++ b/src/Network/BitTorrent/DHT.hs @@ -41,6 +41,7 @@ import Text.PrettyPrint.Class import Data.Torrent.InfoHash import Network.BitTorrent.Core import Network.BitTorrent.DHT.Message +import Network.BitTorrent.DHT.Routing import Network.BitTorrent.DHT.Session import Network.KRPC @@ -103,6 +104,8 @@ bootstrap startNodes = do $(logInfoS) "bootstrap" "Node bootstrapping finished" where insertClosest addr = do + t <- getTable + unless (full t) $ do nid <- getNodeId result <- try $ FindNode nid <@> addr case result of -- cgit v1.2.3