diff options
author | joe <joe@jerkface.net> | 2017-11-06 05:18:04 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-11-08 02:30:43 -0500 |
commit | 70a96073db817b19e98d058702b1a8aa3d4b8445 (patch) | |
tree | 83414727033ad1fb66ea6289a20495b275a4e13c /examples | |
parent | 6749c25eb6bf544ebef51817049c922030e8369d (diff) |
Bootstrapping rework in progress.
Diffstat (limited to 'examples')
-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 () |