diff options
Diffstat (limited to 'examples/dhtd.hs')
-rw-r--r-- | examples/dhtd.hs | 9 |
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(..)) | |||
61 | import Network.QueryResponse | 61 | import Network.QueryResponse |
62 | import Network.StreamServer | 62 | import Network.StreamServer |
63 | import Network.Kademlia | 63 | import Network.Kademlia |
64 | import Network.Kademlia.Bootstrap (bootstrap) | 64 | import Network.Kademlia.Bootstrap |
65 | import Network.Kademlia.Search | 65 | import Network.Kademlia.Search |
66 | import qualified Network.BitTorrent.MainlineDHT as Mainline | 66 | import qualified Network.BitTorrent.MainlineDHT as Mainline |
67 | import qualified Network.Tox as Tox | 67 | import 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 () |