Permalink
Browse files

Initial seeding may work.

  • Loading branch information...
1 parent 7a5d723 commit 53f1bd7d6135ee6b02ded58f585fd1ac9970621d @alanz committed Apr 30, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/TeleHash/TeleHash.hs
@@ -568,6 +568,13 @@ setup arg =
-- ---------------------------------------------------------------------
+setState :: SwitchState -> TeleHash ()
+setState state = do
+ master <- get
+ put $ master {selfState = state }
+
+-- ---------------------------------------------------------------------
+
pingSeeds :: TeleHash ()
pingSeeds = do
seeds <- gets selfSeeds
@@ -579,6 +586,7 @@ pingSeeds = do
-- TODO: rotate the seeds, so the we use a fresh one each time through
case (not connected) && (seeds /= []) of
True -> do
+ setState StateSeeding
nextSeed <- rotateToNextSeed
pingSeed nextSeed
False -> return ()

0 comments on commit 53f1bd7

Please sign in to comment.