From ff5be0e63bf22826c522ebb3a943d581912ff492 Mon Sep 17 00:00:00 2001 From: Jeromy Date: Mon, 6 Mar 2017 23:23:48 -0800 Subject: [PATCH] seed rand for generation of peer IDs in echo example --- examples/echo/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/echo/main.go b/examples/echo/main.go index 47e7ebd..ae42a45 100644 --- a/examples/echo/main.go +++ b/examples/echo/main.go @@ -6,7 +6,9 @@ import ( "fmt" "io/ioutil" "log" + "math/rand" "strings" + "time" golog "github.com/ipfs/go-log" host "github.com/libp2p/go-libp2p-host" @@ -62,6 +64,7 @@ func makeBasicHost(listen string, secio bool) (host.Host, error) { } func main() { + rand.Seed(time.Now().UnixNano()) golog.SetAllLoggers(gologging.INFO) // Change to DEBUG for extra info listenF := flag.Int("l", 0, "wait for incoming connections") target := flag.String("d", "", "target peer to dial") -- GitLab