diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2019-01-23 13:04:02 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:21 +0800 |
commit | 36e65e7017fc87c44b52b736e09585fc2bfc1e3b (patch) | |
tree | 01c0bd136d560f8657b16aa2a4bc9270205306e7 /vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go | |
parent | d1d2cc0736440d7d6154df11f8cb9281c3e3f7f7 (diff) | |
download | go-tangerine-36e65e7017fc87c44b52b736e09585fc2bfc1e3b.tar go-tangerine-36e65e7017fc87c44b52b736e09585fc2bfc1e3b.tar.gz go-tangerine-36e65e7017fc87c44b52b736e09585fc2bfc1e3b.tar.bz2 go-tangerine-36e65e7017fc87c44b52b736e09585fc2bfc1e3b.tar.lz go-tangerine-36e65e7017fc87c44b52b736e09585fc2bfc1e3b.tar.xz go-tangerine-36e65e7017fc87c44b52b736e09585fc2bfc1e3b.tar.zst go-tangerine-36e65e7017fc87c44b52b736e09585fc2bfc1e3b.zip |
params: Update testnet config (#167)
* vendor: sync to latest core
* param: update testnet config
* params: update dmoment
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go b/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go index 7e89c059d..63d25a3fc 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go @@ -2,13 +2,20 @@ package common import ( "math/rand" + "time" ) +var random *rand.Rand + +func init() { + random = rand.New(rand.NewSource(time.Now().Unix())) +} + // NewRandomHash returns a random Hash-like value. func NewRandomHash() Hash { x := Hash{} for i := 0; i < HashLength; i++ { - x[i] = byte(rand.Int() % 256) + x[i] = byte(random.Int() % 256) } return x } |