Skip to content

Commit

Permalink
Initial seeding may work.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanz committed Apr 30, 2012
1 parent 7a5d723 commit 53f1bd7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/TeleHash/TeleHash.hs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -568,6 +568,13 @@ setup arg =


-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------


setState :: SwitchState -> TeleHash ()
setState state = do
master <- get
put $ master {selfState = state }

-- ---------------------------------------------------------------------

pingSeeds :: TeleHash () pingSeeds :: TeleHash ()
pingSeeds = do pingSeeds = do
seeds <- gets selfSeeds seeds <- gets selfSeeds
Expand All @@ -579,6 +586,7 @@ pingSeeds = do
-- TODO: rotate the seeds, so the we use a fresh one each time through -- TODO: rotate the seeds, so the we use a fresh one each time through
case (not connected) && (seeds /= []) of case (not connected) && (seeds /= []) of
True -> do True -> do
setState StateSeeding
nextSeed <- rotateToNextSeed nextSeed <- rotateToNextSeed
pingSeed nextSeed pingSeed nextSeed
False -> return () False -> return ()
Expand Down

0 comments on commit 53f1bd7

Please sign in to comment.