summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-11-06 05:18:04 -0500
committerjoe <joe@jerkface.net>2017-11-08 02:30:43 -0500
commit70a96073db817b19e98d058702b1a8aa3d4b8445 (patch)
tree83414727033ad1fb66ea6289a20495b275a4e13c /examples
parent6749c25eb6bf544ebef51817049c922030e8369d (diff)
Bootstrapping rework in progress.
Diffstat (limited to 'examples')
-rw-r--r--examples/dhtd.hs9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs
index d1db1938..7d3661e6 100644
--- a/examples/dhtd.hs
+++ b/examples/dhtd.hs
@@ -61,7 +61,7 @@ import Network.Address hiding (NodeId, NodeInfo(..))
61import Network.QueryResponse 61import Network.QueryResponse
62import Network.StreamServer 62import Network.StreamServer
63import Network.Kademlia 63import Network.Kademlia
64import Network.Kademlia.Bootstrap (bootstrap) 64import Network.Kademlia.Bootstrap
65import Network.Kademlia.Search 65import Network.Kademlia.Search
66import qualified Network.BitTorrent.MainlineDHT as Mainline 66import qualified Network.BitTorrent.MainlineDHT as Mainline
67import qualified Network.Tox as Tox 67import qualified Network.Tox as Tox
@@ -1323,7 +1323,12 @@ main = do
1323 case Map.lookup "node" qrys of 1323 case Map.lookup "node" qrys of
1324 Just DHTQuery { qsearch = srch } -> do 1324 Just DHTQuery { qsearch = srch } -> do
1325 case eqT of 1325 case eqT of
1326 Just witness -> bootstrap (isNodesSearch witness srch) bkts ping btSaved fallbackNodes 1326 Just witness -> let strapper = BucketRefresher
1327 { refreshSearch = isNodesSearch witness srch
1328 , refreshBuckets = bkts
1329 , refreshPing = ping
1330 }
1331 in bootstrap strapper btSaved fallbackNodes
1327 _ -> error $ "Missing node-search for "++netname++"." 1332 _ -> error $ "Missing node-search for "++netname++"."
1328 saveNodes netname dht 1333 saveNodes netname dht
1329 Nothing -> return () 1334 Nothing -> return ()