From bffc4410c72dbe2b9461ef78867f972f939a95a4 Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Thu, 13 Dec 2018 10:45:29 +0800 Subject: dex, cmd: Add DMoment to command line (#87) --- dex/backend.go | 8 ++------ dex/config.go | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'dex') diff --git a/dex/backend.go b/dex/backend.go index 8153dc2ed..5ea30b1a9 100644 --- a/dex/backend.go +++ b/dex/backend.go @@ -166,12 +166,8 @@ func New(ctx *node.ServiceContext, config *Config) (*Dexon, error) { privKey := coreEcdsa.NewPrivateKeyFromECDSA(config.PrivateKey) - // TODO(w): set this correctly in config. - now := time.Now() - dMoment := time.Date( - now.Year(), now.Month(), now.Day(), - now.Hour(), now.Minute(), (now.Second()/5+1)*5, - 0, now.Location()) + dMoment := time.Unix(config.DMoment, int64(0)) + log.Info("DEXON Consensus DMoment", "time", dMoment) dex.consensus = dexCore.NewConsensus(dMoment, dex.app, dex.governance, blockdb.NewDatabase(chainDb), dex.network, privKey, log.Root()) diff --git a/dex/config.go b/dex/config.go index 924e18d53..5f148cc03 100644 --- a/dex/config.go +++ b/dex/config.go @@ -118,4 +118,7 @@ type Config struct { // RPCGasCap is the global gas cap for eth-call variants. RPCGasCap *big.Int `toml:",omitempty"` + + // Dexon options + DMoment int64 } -- cgit v1.2.3