summaryrefslogtreecommitdiff
path: root/examples/dhtd.hs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/dhtd.hs')
-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 ()