From e8326992de2ed9b961570b7379b0c091f1f9e051 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Mon, 22 Oct 2018 19:53:24 +0800 Subject: dex: fix round switching and initialize dMoment correctly --- dex/backend.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'dex') diff --git a/dex/backend.go b/dex/backend.go index 9c931ee2c..2ad7c16be 100644 --- a/dex/backend.go +++ b/dex/backend.go @@ -174,7 +174,14 @@ func New(ctx *node.ServiceContext, config *Config) (*Dexon, error) { dex.network = NewDexconNetwork(pm) privKey := coreEcdsa.NewPrivateKeyFromECDSA(config.PrivateKey) - dMoment := time.Date(2018, 10, 15, 6, 0, 0, 0, time.UTC) + + // 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()) + dex.consensus = dexCore.NewConsensus(dMoment, dex.app, dex.governance, db, dex.network, privKey, log.Root()) return dex, nil -- cgit v1.2.3