tAlso use local nodes know to redis in fetchDirlist(). - tordam - A library for peer discovery inside the Tor network (HTM) git clone https://git.parazyd.org/tordam (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit b1736dfbc006d5e9e7c589f8e30b138520d9915c (DIR) parent 7e61c981f5539bf669653ba3f6a277fcab6c812a (HTM) Author: parazyd <parazyd@dyne.org> Date: Tue, 20 Feb 2018 13:37:15 +0100 Also use local nodes know to redis in fetchDirlist(). Diffstat: M cmd/dam-client/main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) --- (DIR) diff --git a/cmd/dam-client/main.go b/cmd/dam-client/main.go t@@ -154,6 +154,7 @@ func fetchDirlist(locations []string) ([]string, error) { var dirSlice, dirlist []string log.Println("Grabbing a list of directories.") + // Remote network entry points for _, i := range locations { log.Println("Fetching", i) dirs, err := lib.HTTPDownload(i) t@@ -172,7 +173,16 @@ func fetchDirlist(locations []string) ([]string, error) { } } - // TODO: fill dirSlice with info from our redis and start making a hydra. + // Local nodes known to redis + nodes, err := lib.RedisCli.Keys("*.onion").Result() + lib.CheckError(err) + for _, i := range nodes { + valid, err := lib.RedisCli.HGet(i, "valid").Result() + lib.CheckError(err) + if valid == "1" { + dirSlice = append(dirSlice, i) + } + } if len(dirSlice) < 1 { log.Fatalln("Couldn't get any directories. Exiting.")