Commit 9d2ff19d authored by Andrei Mihu's avatar Andrei Mihu
Browse files

Update changelog.

parent d81c3a62
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr

### Changed
- Improve Stackdriver log format timestamp and message field formats.
- Use crypto random to seed global random instance if possible.

### Fixed
- Fix the registered function name for 'nk.channelIdBuild' in the JavaScript runtime.
+3 −4
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ package main

import (
	"context"
	cryptorand "crypto/rand"
	cryptoRand "crypto/rand"
	"encoding/binary"
	"flag"
	"fmt"
@@ -103,10 +103,9 @@ func main() {
	startupLogger.Info("Node", zap.String("name", config.GetName()), zap.String("version", semver), zap.String("runtime", runtime.Version()), zap.Int("cpu", runtime.NumCPU()), zap.Int("proc", runtime.GOMAXPROCS(0)))
	startupLogger.Info("Data directory", zap.String("path", config.GetDataDir()))

	// Initialize the global random obj with customs seed.
	// Initialize the global random with strongly seed.
	var seed int64
	err := binary.Read(cryptorand.Reader, binary.BigEndian, &seed)
	if err != nil {
	if err := binary.Read(cryptoRand.Reader, binary.BigEndian, &seed); err != nil {
		startupLogger.Warn("Failed to get strongly random seed, fallback to a less random one.", zap.Error(err))
		seed = time.Now().UnixNano()
	}