From 1075bfdec5ba01833be01e2ef6998731f8acbd36 Mon Sep 17 00:00:00 2001 From: tau3 Date: Wed, 19 Feb 2020 22:48:22 +0400 Subject: [PATCH] fixed import order; using crypto rand --- p2p/pex/addrbook.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/p2p/pex/addrbook.go b/p2p/pex/addrbook.go index c470071cd..84051093c 100644 --- a/p2p/pex/addrbook.go +++ b/p2p/pex/addrbook.go @@ -5,19 +5,21 @@ package pex import ( + crand "crypto/rand" "encoding/binary" "fmt" + "math" + "math/rand" + "net" + "sync" + "time" + "github.com/minio/highwayhash" "github.com/tendermint/tendermint/crypto" tmmath "github.com/tendermint/tendermint/libs/math" tmrand "github.com/tendermint/tendermint/libs/rand" "github.com/tendermint/tendermint/libs/service" "github.com/tendermint/tendermint/p2p" - "math" - "math/rand" - "net" - "sync" - "time" ) const ( @@ -104,8 +106,7 @@ var hashKey []byte func init() { highwayKeyLength := 32 hashKey = make([]byte, highwayKeyLength) - rand.Seed(time.Now().UnixNano()) - rand.Read(hashKey) + crand.Read(hashKey) } // NewAddrBook creates a new address book.